WordPress: Show title and alt on images

To add image alt and title attributes to images, add the following to functions.php: function add_image_title( $attr, $attachment= null ) {     $img_title= trim( strip_tags( $attachment->post_title ) );     $attr['title'] = $img_title;     $attr['alt'] = $img_title;     return$attr; } add_filter( 'wp_get_attachment_image_attributes','add_imgage_title', 10, 2 ); or replace $attr['title'] with: $attr['title'] = the_title_attribute( 'echo=0' );

By | March 24th, 2017|WordPress|0 Comments

WordPress: Two Columns using More button

1) Ensure you have added <!--more-->  in page content. Use the more button! 2) Use the following code to display content in two columns: global $more; $more = 0; echo '<div id="column_one">'; echo '&nbsp;'; the_content(''); echo '</div>'; $more = 1; echo '<div id="column_two">'; the_content('read more', true); echo '</div>'; 3) CSS to tidy it up: #column_one, [...]

By | March 7th, 2017|WordPress|0 Comments

WordPress: List all queries on the page

This code snippet will list all the queries executed on your WordPress page Add this to the bottom of the page: <?php if (current_user_can('administrator')){ global $wpdb; echo "<pre>"; print_r($wpdb->queries); echo "</pre>"; } ?>

By | June 28th, 2016|WordPress|0 Comments

WordPress: different CSS for different objects

Site: body { background-image:url('background.jpg'); } Single Page: body.page-id-78 { background-image:url('background.jpg'); } Several Pages: body.page-id-78, body.page-id-79, body.page-id-82 { background-image:url('background.jpg'); } Single Category: .category-CatName { background-image:url('background.jpg'); } Multiple Categories: .category-CatName1, .category-CatName-2 { background-image:url('background.jpg'); } Archive Pages: .archive { background-image:url('background.jpg'); } Custom Template, Post or Category: .page-template-name { background-image:url('background.jpg'); }

By | November 3rd, 2015|WordPress|0 Comments

What do Web Developers Do?

Excellent list of skills required to be a web developer in 2015: See here.

By | May 21st, 2015|Web Development|0 Comments

Web Site Objectives

As with any other aspect of your business, you want to know that your website is working for you. Just as you wouldn't keep spending money on television advertisements or glossy brochures unless they were helping you to achieve your business goals, nor should your website go unchecked. The first step is to clearly understand [...]

By | January 30th, 2015|Web Development|0 Comments

Must Have WordPress Plug-Ins

All In One SEO Pack Out-of-the-box SEO for your WordPress blog. Contact Form 7 Just another contact form plugin. Simple but flexible. Google Analytics for WordPress This plugin makes it simple to add Google Analytics to your WordPress blog, adding lots of features, eg. custom variables and automatic clickout and download tracking. Google XML Sitemaps [...]

By | January 30th, 2015|WordPress|0 Comments

Set Apache Root Directory

How to Set the Apache Web Site Root Directory The DocumentRoot directive is used to specify the web server's root directory, so if you make a request to http://localhost/ Apache will map that address with the directory specified in DocumentRoot. Open up httpd.conf (in your Apache/conf directory), find DocumentRoot and set it to be your [...]

By | January 16th, 2015|Technical|0 Comments

Installing Apache, PHP and MySQL

Our recommendation is to always use XAMPP! Fast and easy to install, either on Windows or Linux, it does all the hard work for you. The 1.8.1 version of the toolset includes: Apache 2.4.3 MySQL 5.5.27 PHP 5.4.7 phpMyAdmin 3.5.2.2 The Control Panel includes service start and stop as well as options to configure and [...]

By | January 16th, 2015|Technical|0 Comments

WordPress Shortcut Icon (Favicon)

In HTML, it's relatively simple to add a Shortcut Icon, you would need to add the following between <head> and </head> in all your html pages: <link rel="shortcut icon" href="http://www.domain.com/favicon.ico" type="image/x-icon">The word 'shortcut' is not always used (ie; rel="icon" is ok), it's added for backwards browser compatibility. Only type="image/gif", type="image/x-icon" and type="image/png" are supported in [...]

By | January 16th, 2015|WordPress|0 Comments