WordPress: Easy to remember template hierarchy

Aide memoir for the WordPress template hiearchy... Default for everything - archive pages, single posts and single pages (as well as all other content types): 1st: index.php Select template by page for specific archive displays, like category and taxonomy archives or templates for different page layouts: 1st: template_{$custom-post-type}.php or template_{NOSIDEBAR}.php 2nd: index.php For all pages [...]

By | July 21st, 2017|WordPress|0 Comments

WordPress: useful additions to functions.php

/* * Useful snippets for functions.php /* /* * Add support for the following: */ add_theme_support( 'title-tag' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) ); /* * Register Menus */ function register_my_menus(){ register_nav_menus( array( 'primary' => __('Primary Menu', 'AD'), ) ); } add_action('init', 'register_my_menus'); /* * Allow php in widget */ [...]

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

WordPress: Must have plugins, updated

Must Haves All In One SEO Pack Out-of-the-box SEO for your WordPress blog. WordFence THE security plugin. WP Optimize Clean Up / Optimise your WordPress installation. WP Super Cache WordPress Caching. WP Smush It Optimise graphics files. WP Migrate DB WordPress database migration. Used in Specific Circumstances Advanced Custom Fields Provides simple flexibility. Post Types [...]

By | July 1st, 2017|WordPress|0 Comments

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

WordPress, must have plugins

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