<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Life on Lars &#187; WordPress</title>
	<atom:link href="http://lifeonlars.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://lifeonlars.com</link>
	<description>Design, the Universe and Everything</description>
	<lastBuildDate>Fri, 26 Aug 2011 01:59:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to add Multiple Featured Images in WordPress</title>
		<link>http://lifeonlars.com/wordpress/how-to-add-multiple-featured-images-in-wordpress/</link>
		<comments>http://lifeonlars.com/wordpress/how-to-add-multiple-featured-images-in-wordpress/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 01:59:54 +0000</pubDate>
		<dc:creator>larfa</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Post Thumbnails]]></category>
		<category><![CDATA[Theme Development]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.lifeonlars.com/?p=440</guid>
		<description><![CDATA[The post thumbnails feature aka. Featured Image was added to WordPress back in version 2.9 and made it significantly easier for users to associate images with posts or pages. Prior to that we we had to upload an image, copy the url for the image and add that as a custom field if we wanted [...]]]></description>
			<content:encoded><![CDATA[<p>The post thumbnails feature aka. Featured Image was added to WordPress back in version 2.9 and made it significantly easier for users to associate images with posts or pages. Prior to that we we had to upload an image, copy the url for the image and add that as a custom field if we wanted to do something similar, which is ok when you know how to do it yourself but less than ideal when having to explain the process to clients or other authors. The post thumbnails feature allows you to easily set a single &#8220;Featured Image&#8221; for a post or page via a separate meta box in the WordPress admin. You simply click on the &#8220;Set featured image&#8221; link, open up the image dialog, upload or select an image then click the &#8220;use as featured image&#8221; link. </p>
<p>This works fine for the vast majority of cases but sometimes it would be great to have have more than one image for a post. For example if you have a folio section or a product where you may want to have multiple images. I tried searching for &#8220;mulitple post thumbnails&#8221;, &#8220;multiple featured images&#8221; and so on but most of the &#8220;solutions&#8221; were mainly about looping through all post attachments and displaying these. This can work in some instances but it didn&#8217;t provide as much control as I wanted and if you happened to have other images in the post then these would also be displayed. </p>
<p>Eventually I came across a plugin called <a target="_blank" href="http://wordpress.org/extend/plugins/multiple-post-thumbnails/">Multiple Post Thumbnails</a> and decided to tweak that slightly and integrate it directly into my theme instead of using it as a separate plugin. This is how I did it.</p>
<p><span id="more-440"></span></p>
<h2>Adding support for post thumbnails in your WordPress theme</h2>
<p>First things first, before you start adding support for multiple post thumbnails you need to ensure you have the basic post thumbnails enabled for your theme. Check your functions.php file and make sure the following line is present, if not add it in. </p>
<pre class="brush: php; title: ; notranslate"> add_theme_support( 'post-thumbnails' ); </pre>
<p>You can also define additional sizes for your post thumbnails. </p>
<pre class="brush: php; title: ; notranslate">
// Add Custom image sizes
// Note: 'true' enables hard cropping so each image is exactly those dimensions and automatically cropped
add_image_size( 'feature-image', 960, 500, true );
add_image_size( 'medium-thumb', 300, 156, true );
add_image_size( 'small-thumb', 75, 75, true );
</pre>
<h2>Adding the files and support for multiple post thumbnails to your theme</h2>
<ol>
<li>Download the files for the <a target="_blank" href="http://wordpress.org/extend/plugins/multiple-post-thumbnails/">Multiple Post Thumbnails Plugin</a> to your computer</li>
<li>Unzip the files and copy them to a sub-directory in your theme file. There are only two files you will need <em>multi-post-thumbnails.php</em> and <em>multi-post-thumbnails-admin.js</em>. In my case i&#8217;ve placed the PHP file in a <em>library</em> sub-directory in my theme and the JavaScript file in a sub-directory called <em>js</em> inside library.
<pre>
> theme-name
   > library
     - multi-post-thumbnails.php
     > js
       - multi-post-thumbnails-admin.js
</pre>
</li>
<li>Once that&#8217;s done you need to make a small tweak to the multi-post-thumbnails.php file.<br />
<strong>From this (line 143)</strong></p>
<pre class="brush: php; title: ; notranslate">
public function enqueue_admin_scripts() {
    wp_enqueue_script(&quot;featured-image-custom&quot;, plugins_url(basename(dirname(__FILE__)) . '/js/multi-post-thumbnails-admin.js'), array('jquery'));
}
</pre>
<p><strong>To this</strong></p>
<pre class="brush: php; title: ; notranslate">
public function enqueue_admin_scripts() {
    $template_url = get_bloginfo('template_url') . '/js/multi-post-thumbnails-admin.js';
    wp_enqueue_script(&quot;featured-image-custom&quot;,  $template_url, array('jquery'));
}
</pre>
</li>
<li>Then go back to your functions.php file and add the following.
<pre class="brush: php; title: ; notranslate">
// Load external file to add support for MultiPostThumbnails. Allows you to set more than one &quot;feature image&quot; per post.
require_once('library/multi-post-thumbnails.php');
</pre>
<p>It&#8217;s usually a good idea to keep these inclusions at the beginning of your functions.php file so they are included before you try to use any of the functions they add.
</li>
<li>You then need to define some additional post thumbnails and specify which post types they should apply to. The default would be &#8216;post&#8217; but in my case I had created a custom post type called folio where I&#8217;d added 4 extra post thumbnails for a total of up to 5 featured image for each folio item. To do this add the following in functions.php just after the add_image_size entries mentioned above.
<pre class="brush: php; title: ; notranslate">
	// Define additional &quot;post thumbnails&quot;. Relies on MultiPostThumbnails to work
	if (class_exists('MultiPostThumbnails')) {
		new MultiPostThumbnails(array(
			'label' =&gt; '2nd Feature Image',
			'id' =&gt; 'feature-image-2',
			'post_type' =&gt; 'folio'
			)
		);
		new MultiPostThumbnails(array(
			'label' =&gt; '3rd Feature Image',
			'id' =&gt; 'feature-image-3',
			'post_type' =&gt; 'folio'
			)
		);
		new MultiPostThumbnails(array(
			'label' =&gt; '4th Feature Image',
			'id' =&gt; 'feature-image-4',
			'post_type' =&gt; 'folio'
			)
		);
		new MultiPostThumbnails(array(
			'label' =&gt; '5th Feature Image',
			'id' =&gt; 'feature-image-5',
			'post_type' =&gt; 'folio'
			)
		);		

	};
</pre>
</li>
</ol>
<p>That&#8217;s it, you&#8217;ve now added support for mulitple post thumbnails for your post or custom post type and you should see several &#8220;Featured Images&#8221; boxes in your admin screen. This is what mine looked like. </p>
<p><img src="http://lifeonlars.com/wp-content/uploads/multiple-featured-images-11.jpg" alt="" title="multiple-featured-images-1" width="962" height="834" class="alignnone size-full wp-image-448" /><br />
<img src="http://lifeonlars.com/wp-content/uploads/multiple-featured-images-21.jpg" alt="" title="multiple-featured-images-2" width="646" height="207" class="alignnone size-full wp-image-450" /></p>
<h2>Displaying the post thumbnails in your WordPress posts</h2>
<p>So now you&#8217;ve (hopefully) got the admin part working and are able to add multiple post thumbnails to your posts, but you also need to output these in your post or page template. Continuing on my folio concept I wanted to output these images to use in a JavaScript slider. I happened to be using the Nivo Slider at the time but it doesn&#8217;t really matter what you use, you&#8217;ll just need to tweak the HTML output to match what your slider expects.</p>
<p>This is where the added control of the featured images comes in handy over just scanning through attachments, you might find it easier just to upload a bunch of images and let WordPress use all of the attachments but I needed control over the order and also wanted the freedom to add more images into the description of a folio item without having to worry about it ending up in the slider. </p>
<p>Here&#8217;s the PHP code. I&#8217;ll try to explain a bit more how it works. The listing is done in two steps. First we show the standard featured image, we then loop through and display all the extra featured images. Because I wanted to use the Nivo slider thumbnail view I had to include a REL attribute with the url for the thumbnail version of the image. After a lot of searching I finally figured that I could add an array of attributes when calling the_post_thumbnail() and this also worked for wp_get_attachment_image() which I ended up having to use instead of the standard MultiPostThumbnails::the_post_thumbnail(). </p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;slider&quot;&gt;
    &lt;?php
        // Checks if post has a feature image, grabs the feature-image and outputs that along with thumbnail SRC as a REL attribute
        if (has_post_thumbnail()) { // checks if post has a featured image and then outputs it.
            $image_id = get_post_thumbnail_id ($post-&gt;ID );
            $image_thumb_url = wp_get_attachment_image_src( $image_id,'small-thumb');
            $attr = array(
                'class'	=&gt; &quot;folio-sample&quot;,
                'rel' =&gt; $image_thumb_url[0], // REL attribute is used to show thumbnails in the Nivo slider, can be skipped if you don't want thumbs or using other slider
            );
            the_post_thumbnail ('feature-image', $attr);
        }
        if (class_exists('MultiPostThumbnails')) {
        // Loops through each feature image and grabs thumbnail URL
        $i=1;
            while ($i&lt;=5) {
                $image_name = 'feature-image-'.$i;  // sets image name as feature-image-1, feature-image-2 etc.
                if (MultiPostThumbnails::has_post_thumbnail('folio', $image_name)) {
                    $image_id = MultiPostThumbnails::get_post_thumbnail_id( 'folio', $image_name, $post-&gt;ID );  // use the MultiPostThumbnails to get the image ID
                    $image_thumb_url = wp_get_attachment_image_src( $image_id,'small-thumb');  // define thumb src based on image ID
                    $image_feature_url = wp_get_attachment_image_src( $image_id,'feature-image' ); // define full size src based on image ID
                    $attr = array(
                        'class'	=&gt; &quot;folio-sample&quot;,      // set custom class
                        'rel' =&gt; $image_thumb_url[0],   // sets the url for the image thumbnails size
                        'src' =&gt; $image_feature_url[0], // sets the url for the full image size
                    );
                    // Use wp_get_attachment_image instead of standard MultiPostThumbnails to be able to tweak attributes
                    $image = wp_get_attachment_image( $image_id, 'feature-image', false, $attr );
                    echo $image;
                }
                $i++;
            }                            

        }; // end if MultiPostThumbnails
     ?&gt;
&lt;/div&gt;&lt;!-- end #slider --&gt;
</pre>
<p>Now all of this can be done a lot easier just using the standard call from the plugin e.g. </p>
<pre class="brush: php; title: ; notranslate">
if (class_exists('MultiPostThumbnails') {
    if (MultiPostThumbnails::has_post_thumbnail('folio', 'feature-image-2')) {
        MultiPostThumbnails::the_post_thumbnail('folio', 'feature-image-2');
    }
    if (MultiPostThumbnails::has_post_thumbnail('folio', 'feature-image-3')) {
        MultiPostThumbnails::the_post_thumbnail('folio', 'feature-image-3');
    }
    if (MultiPostThumbnails::has_post_thumbnail('folio', 'feature-image-3')) {
        MultiPostThumbnails::the_post_thumbnail('folio', 'feature-image-3');
    }
}
</pre>
<p>However because I needed the extra control over the output of attributes I ended up having to do it a bit more complex. If you&#8217;re planning on using the featured images in a slider that requires specific classes, attributes or HTML structure then you may need to go down the same route I&#8217;ve done. Hopefully with the code above most of the hard work will be done for you already.  </p>
<h2>Final words</h2>
<p>Well there you have it, if everything went well you should have a working post with multiple post thumbnails and a more elegant way of adding multiple feature images to your posts. If you&#8217;re doing work for clients I think this approach will be a bit more user friendly than trying to explain attachments or pasting in URLs into custom fields. The cool thing is that you can set featured images for completely different uses on the same post as well. They don&#8217;t need to be called feature images. If you&#8217;re doing a real estate web site you could have some images defined as interior, some for exterior and a separate one for floorplan which will give you the control needed to output the right images where needed. It also guides the authors to what they need to add. </p>
<p>Until WordPress 3.3 comes out and hopefully Plupload is integrated into the dashboard this is a pretty decent solution, at least compared to anything else I&#8217;ve seen so far. </p>
]]></content:encoded>
			<wfw:commentRss>http://lifeonlars.com/wordpress/how-to-add-multiple-featured-images-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>WordPress SEO 101: 5 Easy Steps for Better WP SEO</title>
		<link>http://lifeonlars.com/seo/wordpress-seo-101-5-easy-steps-for-better-wp-seo/</link>
		<comments>http://lifeonlars.com/seo/wordpress-seo-101-5-easy-steps-for-better-wp-seo/#comments</comments>
		<pubDate>Tue, 04 May 2010 23:36:52 +0000</pubDate>
		<dc:creator>larfa</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[WP Code Snippets]]></category>

		<guid isPermaLink="false">http://www.lifeonlars.com/?p=319</guid>
		<description><![CDATA[WordPress offers pretty good basic SEO by default and by spending a bit of time focusing on a few additional areas your on-page and on-site SEO will gain a significant boost. If you&#8217;re creating a new site, creating a new design and theme for an existing site or just updating your current theme to be [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress offers pretty good basic SEO by default and by spending a bit of time focusing on a few additional areas your on-page and on-site SEO will gain a significant boost. If you&#8217;re creating a new site, creating a new design and theme for an existing site or just updating your current theme to be a bit more SEO friendly the principles are pretty much the same. If you already have a working site and theme then don&#8217;t worry most of the following SEO tweaks can be done with a few code snippets and plugins added to your existing WordPress site. This article will cover 5 optimisation areas that will improve your WordPress on-page and on-site SEO.</p>
<p><span id="more-319"></span></p>
<p>In the coming days and weeks I will also be adding additional articles featuring more intermediate and advanced WordPress SEO tips and eventually expanding more on off-site SEO factors and link building strategies. </p>
<h2>5 Core WordPress SEO optimisation areas</h2>
<ol>
<li>Changing your WordPress permalinks</li>
<li>Optimsing WordPress page titles</li>
<li>Optimising WordPress meta description and meta keywords</li>
<li>Customising your &quot;more links&quot;</li>
<li>Optimise site name and description(s)</li>
</ol>
<h2>Thoughts on using WordPress SEO plugins</h2>
<p>Almost all of the optimisation areas mentioned can be achiveved with plugins. Likewise pretty much everything the plugins do can be achieved through modifications to your theme. If you feel comfortable updating your theme and you don&#8217;t like plugins messing with your beautifully crafted HTML output then you&#8217;ll probably want to tweak your theme by adding relevant code snippets to do the majority of what the plugins can offer. </p>
<p>Personally I do a bit of both, I like to optimise my themes as much as possible but still use plugins to fill in the gaps. Plugins are particularly useful if you like to tweak titles or descriptions on a post/page level and can save you qutie a bt of time for repetivite tasks. A word of caution though, don&#8217;t rely 100% on plugins to create completely automated descriptions, they are never as good as handcrafted descriptions. </p>
<h2>Start off with a well structured WP theme</h2>
<p>If you&#8217;re creating a new site or want create a new theme for your site it helps if you can build your site around a WordPress theme that is structured and coded well. Starting out with a theme that is at least partially SEO friendly will save you time but it&#8217;s not required. </p>
<p>When selecting a theme either to use as a starting point or to use as it is have a peak at the the code of the theme first, both viewing the PHP files and the source code of the HTML output. Look out for a theme that is well coded and well structured, something that already includes title attributes on links and images has clear navigation and .</p>
<p>One important factor is to make sure your theme always lists your content before the sidebar when viewing the source code of your site, regardless of where the sidebar is located visually in the design. This ensures that crawlers look at your unique content first and the sidebar content is secondary as it tends to be listed on all pages of your site. </p>
<h2>1. Change WordPress default permalinks</h2>
<p>One of the first things you should do after a fresh WordPress install is to change the permalink structure. By default the WordPress permalink structure is <code>?p=&lt;postid&gt;</code>. For both SEO and usability purposes you&#8217;d want your links to be descriptive e.g. /categoryname/postname or just /postname.  WordPress permalink settings can be found in your  WP admin interface under Settings &gt; Permalinks. </p>
<p><img src="http://lifeonlars.com/wp-content/uploads/permalinks1.png" alt="Interface for changing WP permalinks" title="How to change WordPress Permalinks" width="600" height="244" class="alignnone size-full wp-image-326" /></p>
<p>Under common settings select &quot;Custom structure&quot;. </p>
<ul>
<li>To display just the post title in your url use. <code>/%postname%/</code></li>
<li>Alternatively use <code>/%category%/%postname%/</code> if you want to to include the category name before the post title.</li>
</ul>
<h3>Before you change your WordPress Permalinks</h3>
<p>If you&#8217;re setting up a new blog with little or no existing content then changing permalinks is a no-brainer. Just change the settings before any of your content is indexed,  However if you&#8217;re optimising an existing site then changing permalinks can have a huge impact unless take the necessary steps to setup  up redirection.</p>
<p>Before you change permalinks on an existing website that has been established for a while consider the following:</p>
<ul>
<li>If your pages have Page Rank (PR) any change to the permalink will result in a loss in page rank for that page. If you setup a 301 redirect some of the page rank will normally pass to your new permalink but is a risk of some  decay in page rank. </li>
<li>Incoming links from other sites will return 404 errors unless you setup 301 redirection to the new permalink</li>
</ul>
<h3>WordPress Permalink Redirection Plugins</h3>
<p>Now that you know the potential impact of changing established permalinks The good news is that this can be addressed relatively easily  using plugins.  </p>
<p><a href="http://wordpress.org/extend/plugins/redirection/" target="_blank">Redirection</a>  provides you with very granular control over redirects including ability to import a list or redirects from an existing .htaccess file as well as forcing either www or non-www prefix on your site for canonical urls. Once this plugin has been installed go to Tools &gt; Redirection for settings.</p>
<p>  If you&#8217;re usiing <a href="http://wordpress.org/extend/plugins/platinum-seo-pack/" target="_blank">Platinum SEO Pack</a>  you won&#8217;t need a separate plugin as it includes automatic redirection for changes in URLs and  permalink structure. </p>
<p> Keep in mind though if you do have significant page rank on some of your pages you may still lose some of the page rank even with a 301 redirect. This is  typically  more common if you migrate your site completely to a new domain and not really a problem when using 301 redirect for internal site changes. Personally I don&#8217;t really fuss to much about page rank, I mean it&#8217;s nice if my site or some of my pages get a little bit of a boost and it does seem to improve Google rankings a bit, however  at the lower end of the specter PR1-5 it doesn&#8217;t really matter that much. </p>
<h2>2. Optimising WordPress page titles</h2>
<p>By default your WordPress page titles will typically include your site name on the home page and &quot;Site name » Archive » Post title&quot; for archives and posts. This is not terrible but it could be better. </p>
<ul>
<li>Page titles should ideally be no longer than 60-70 characters, this is a general guideline from Google and it&#8217;s not an absolute requirement but you should try to stay below 100 characters.</li>
<li>The reason this is important is because if your page titles are longer they will be cut off in the SERPs (search engine results pages). If your title is longer than 70 characters Google will typically  cut it off before 69 characters and end with &#8230; </li>
<li>If you have a long site name and category name(s) and these are listed first then you run the risk of your actual article or post title being cut off or disappearing completely.</li>
<li>Search engines also tend to weight keywords early in the title a bit higher and you&#8217;d to ensure that your  carefully crafted post titles are visible and given all the emphasis possible.</li>
<li>Your  &lt;title&gt; should be as close as possible to your &lt;h1&gt; page/post title. By starting with your post/page title the first part of your &lt;title&gt; will match your &lt;h1&gt; post title. </li>
</ul>
<p>Personally I&#8217;d avoid including categories on post or pages as it tends to make the titles too long.</p>
<h3>Opimising your titles with plugins</h3>
<p>If you&#8217;re using Headspace2, All-In-One SEO or Platinum SEO Pack it&#8217;s very easy to set your titles either in the global settings for the plugin or on an individual post level. I prefer the following title structure:</p>
<ul>
<li>Home page: %blog-title% | %tagline%</li>
<li>Posts: %post_title% | %blog_title%</li>
<li>Pages: %page_title% | %blog_title% </li>
<li>Category pages: %category_title% | %blog_title%</li>
</ul>
<p>
The settings screens for page titles are pretty much identical for All-in-One SEO and Platinum SEO Pack. The settings screen for Headspace2 is quite different and offers more control but is perhaps slightly more difficult to use for beginners.</p>
<p><img src="http://lifeonlars.com/wp-content/uploads/platinum-seo-page-titles1.png" alt="Platinum SEO Pack Page Title Settings" title="Platinum SEO Pack Page Title Settings" width="600" height="350" class="alignnone size-full wp-image-327" /></p>
<p>You can also change settings and write custom titles and descriptions on individual posts or pages. If you add a title or meta description to an individual post it will override the global settings.</p>
<p><img src="http://lifeonlars.com/wp-content/uploads/platinum-seo-post-options1.png" alt="Platinum SEO Pack Indivdual Post Options" title="Platinum SEO Pack Indivdual Post Options" width="600" height="224" class="alignnone size-full wp-image-328" /></p>
<h3>Customising WordPress titles without using a plugin</h3>
<p>To display the title on your home page or front page as “Blog title | Tagline” and single posts or pages as “Post/page title | Blog title” just add the following code to you header.php replacing the existing &lt;title&gt; tag. </p>
<pre class="brush: php; title: ; notranslate">
&lt;title&gt;
	&lt;?php wp_title(''); ?&gt;&lt;?php if(wp_title('', false)) { echo ' | '; } ?&gt;&lt;?php bloginfo('name'); if(is_home() || is_front_page()) { echo ' | '; bloginfo('description'); } ?&gt;
&lt;/title&gt;
</pre>
<h2>3. Setting up site name and description(s)</h2>
<p>This might seem obvious and very easy to do but it&#8217;s something that can easily be overlooked.</p>
<ul>
<li>On your home page use H1 for your site name and tagline</li>
<li>On all other pages change the site name and tagline either to an h3 or lower or wrap it in a div, personally I prefer changing it to a div as the site name is not what is important on subsequent pages and unless you&#8217;ve got an extremely well known brand it&#8217;s not what people will be searching for either.</li>
</ul>
<p>To only display your blog name and description as h1 and/or h2 on your home page or front page add this code snippet to your theme header.php</p>
<pre class="brush: php; title: ; notranslate">
    &lt;?php if (is_home() || is_front_page()) { ?&gt;
        &lt;h1 id=&quot;blog-title&quot;&gt;&lt;?php bloginfo('name') ?&gt;&lt;/h1&gt;
        &lt;h2 id=&quot;blog-description&quot;&gt;&lt;?php bloginfo('description') ?&gt;&lt;/h1&gt;
    &lt;?php } else { ?&gt;
        &lt;div id=&quot;blog-title&quot;&gt;&lt;?php bloginfo('name') ?&gt;&lt;/div&gt;
        &lt;div id=&quot;blog-description&quot;&gt;&lt;?php bloginfo('description') ?&gt;&lt;/div&gt;
    &lt;?php } ?&gt;
</pre>
<h4>Make good use of the category descriptions</h4>
<p>Spend some time writing descriptions for all your categories. When using <code>wp_list_categories();</code> which is typically used in your main menu or category listing WordPress will by default use the category description as the title attributes for each category. I also like to add the category description as an H2 or H3 on the category archive pages in my theme. Category descriptions can also be used as your meta description on category archive pages. Category descriptions can be edited in your WP admin interface under Posts &gt; Categories. </p>
<p>To display your category description on your category archive pages add the following to you category.php page.</p>
<pre class="brush: php; title: ; notranslate">
	&lt;?php $categorydesc = category_description(); if ( ! empty( $categorydesc ) )
		echo apply_filters( 'archive_meta', '&lt;h2 class=&quot;archive-meta&quot;&gt;' . $categorydesc . '&lt;/h2&gt;' ); ?&gt;
</pre>
<p>Alternatively if you don&#8217;t have a category.php page your can add the folloing to your index.php file or archive.php file.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
	if (is_category()) {
		$categorydesc = category_description(); if ( ! empty( $categorydesc ) )
		echo apply_filters( 'archive_meta', '&lt;h2 class=&quot;archive-meta&quot;&gt;' . $categorydesc . '&lt;/h2&gt;' );
	}
?&gt;
</pre>
<h2>4. Optimising WordPress meta descriptions and keywords</h2>
<h3>Customising  description meta tag in WordPress</h3>
<p>Meta tags have little or no impact on your actual search engine rankings. However your meta description in particular will influence whether people find your site listing in search results interesting enough to click through to your website. Google and other search engines will use meta description as the text you see below the title of the search result in the search results page. </p>
<p><img src="http://lifeonlars.com/wp-content/uploads/serp-metadescription1.png" alt="Google Seach Results Page Description Meta Tag" title="Google Seach Results Page Description Meta Tag" width="650" height="80" class="alignnone size-full wp-image-329" /></p>
<ul>
<li><strong>Home page:</strong> Make sure your home page includes a meta description that describes what your site is about. </li>
<li><strong>Categories: </strong>For category archives you can use the category description</li>
<li><strong>Posts: </strong>On single posts you have multiple options. If you&#8217;ve added excerpts to your posts then they&#8217;re ideal candidates for meta description. </li>
</ul>
<h3>Adding custom meta descriptions in WordPress without a plugin</h3>
<p>If you prefer to add this directly to you theme yourself then use the following code snippet:</p>
<pre class="brush: php; title: ; notranslate">
&lt;meta name=&quot;description&quot; content=&quot;&lt;?php
		// if home page output blog name and description
		if (is_home()) { bloginfo('name'); echo &quot; - &quot;; bloginfo('description');}
		// if single page output either excerpt if available or post title
	    elseif (is_single()) {
        	// check if excerpt exists for the post and output it if it does
        	if (!empty($post-&gt;post_excerpt)) {the_excerpt();}
            // otherwise output the post title
        	else {single_post_title('', true);}
        }
        // if category page output the category description
 	   	elseif (is_category()) {echo category_description();}

        // if it's any other page display this generic description
		else { echo 'Add your own generic site description here';}
	?&gt;&quot;
 /&gt;
</pre>
<p>You can do the same thing for pages, search results, tag archives or date archives with the following conditions:</p>
<ul>
<li>Pages: <code>is_page()</code></li>
<li>Search results: <code>is_search()</code></li>
<li>Tag archives:  <code>is_tag()</code></li>
<li>Date archives: <code>is_date()</code></li>
</ul>
<p>You can also use custom fields to customise your own meta description on individual posts. First replace the elseif (is_single())  the following snippet to the </p>
<pre class="brush: php; highlight: [5,6,8,10,12,13]; title: ; notranslate">
	&lt;meta name=&quot;description&quot; content=&quot;&lt;?php
		// if home page output blog name and description
		if (is_home()) { bloginfo('name'); echo &quot; - &quot;; bloginfo('description');}
		// if single page output either excerpt if available or post title
	    elseif (is_single()) {
           	$custommeta = get_post_meta($post-&gt;ID, &quot;MetaDescription&quot;, true);
        	// checks ot see if the custom field MetaDescription is not empty
            if ($custommeta !=='') {echo $custommeta;}
            // check if excerpt exists for the post and output it if it does
        	elseif (!empty($post-&gt;post_excerpt)) {the_excerpt();}
            // if there's no custom field or excerpt output the post title
        	else {single_post_title('', true);}
        }
        // if category page output the category description
 	   	elseif (is_category()) {echo category_description();}

        // if it's any other page display this generic description
		else { echo 'Add your own generic site description here';}
	?&gt;&quot;
 /&gt;
</pre>
<h3>Using  keywords meta tag in WordPress </h3>
<p>Whilst the description meta tag is useful, the keywords meta tag offers very little benefit for rankings or otherwise. In the early days of search engines this meta tag was often used and abused and as a result most search engines no use it for ranking purposes. Google has specifically stated that they do not give any weighting whatsoever to meta keywords, for further details see <a href="http://googlewebmastercentral.blogspot.com/2009/09/google-does-not-use-keywords-meta-tag.html" target="_blank">Google does not use the keywords meta tag in their ranking</a>.</p>
<p>Even though there&#8217;s very little evidence that meta keywords will help your rankings it certainly doesn&#8217;t hurt to include some relevant keywords in your keywords meta tag. The a quick and simple solutions for this in WordPress is to just list your tags as your meta keywords on individual posts. </p>
<h3>Automatically adding meta descriptions and keywords in WordPress using plugins</h3>
<p>If you&#8217;er using an SEO plugin like Headspace2, Platinum SEO Pack or All-In-One SEO Pack you can set these to automatically add meta descriptions to your site based on a set of rules you can define. They will also allow you to override global settings and customise meta descriptions and keywords on individual posts by via an additional admin panel on the edit posts or page screens.</p>
<h2>5. Customising WordPress &quot;more links&quot;</h2>
<p>Using the <code>&lt;!-- more --&gt;</code> quicktag in WordPress allows you to limit the content shown from a post on your home page, archives or search page. By default the anchor text for more links will just say &quot;read more&quot; which is not great for internal linking. A better solution is to make the anchor text more descriptive and include the post title it&#8217;s linking to. This will is not only good for your internal site SEO but can is also a stronger call to action for your readers. </p>
<h3> Customising WP &quot;more links&quot; with plugins</h3>
<p>If you&#8217;re using Headspace2 or you can go to Settings &gt; Headspace then select Page Modules and drag and drop the more text module into the page module. This will add an option to specify the more text on a post by post basis. Personally I prefer to just use the post title but if you really like to tailor more links on a granular level then Headspace2 will make it easy for you to do so.</p>
<h3>Customising WP &quot;more links&quot; by editing theme files</h3>
<p>If you want to insert something similar in your own theme open up the index.php file, locate where your the_content() is being called and replace is with the following code. This will set the more text to &#8230;continue reading &#8220;post title&#8221; adding quotes around the post title as well as wrapping it in a &lt;strong&gt; tag. It also adds a span around the anchor text with a title attribute listing the title again. </p>
<pre class="brush: php; title: ; notranslate">
&lt;?php the_content('&lt;span class=&quot;readmore&quot; title=&quot;Read full article ' . get_the_title('', '', false) . '&quot;&gt;...continue reading &lt;strong&gt;&quot;' . get_the_title('', '', false) . '&quot;&lt;/strong&gt;&lt;/span&gt;' ); ?&gt;
</pre>
<p>Or alternatively you can use something a bit simpler like:</p>
<pre class="brush: php; title: ; notranslate">
	&lt;?php the_content(&quot;Continue reading &quot; . the_title('', '', false)); ?&gt;
</pre>
<p>If your design does not easily accomodate long anchor text or you don&#8217;t want to display the long anchor text for practical or aesthetic reasons then I suggest you at least include a title attribute on the more link. This won&#8217;t be as effective for SEO purposes but it&#8217;s better than nothing and it will assist your users.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php the_content('&lt;span class=&quot;readmore&quot; title=&quot;Read full article ' . get_the_title('', '', false) . '&quot;&gt;read the full article&lt;/span&gt;'); ?&gt;
</pre>
<h3>Customising WordPress &quot;more links in Thematic </h3>
<p>If you&#8217;re using Thematic just add the following code to your functions.php file. This will add a span around your more link with a class to allow you to style it differently with CSS. It also adds a title attribute to the span with the name of the post it&#8217;s linking to and includes the post name in the anchor text with the prefix &#8230;comintiue reading &#8220;post name&#8221;.</p>
<pre class="brush: php; title: ; notranslate">
function childtheme_more_text($content) {
	$content = '&lt;span class=&quot;readmore&quot; title=&quot;Read full article ' . get_the_title('', '', false) . '&quot;&gt;...continue reading &quot;' . get_the_title('', '', false) . '&quot;&lt;/span&gt;';
	return $content;
}
add_filter('more_text', 'childtheme_more_text');
</pre>
<h2>Bonus Tip: Install the Google XML Sitemaps Plugin</h2>
<p>The <a href="http://wordpress.org/extend/plugins/google-sitemap-generator/" target="_blank">Google XML Sitemaps </a> plugin automatically creates special XML sitemap and submits it to Google, Bing, Yahoo and Ask.com. Using an XML sitemap is a great way to ensure that the search engine robots will find and index all of your pages. It&#8217;s great to ensure new sites are quickly indexed and equally useful for blogs with frequent updates to ensure that new pages and posts are indexed. Using an XML Sitemap does not guarantee that your pages are included in search engines, but it does provide helpful hints for web crawlers to do a better job of crawling your site which is particularly useful if your site structure and internal linking is a bit shoddy. The plugin uses Sitemap Protocol 0.9 defined by <a href="http://www.sitemaps.org/" target="_blank">sitemaps.org</a>. It&#8217;s an open standard with support from the likes of Google, Yahoo and Microsoft.</p>
<h2>Summary </h2>
<p>That&#8217;s it for now, the optimisation areas covered will improve your general on-page SEO for WordPress and hopefully give you a bit of a  boost in rankings. In the next article I&#8217;ll be covering Canonical URLs and how to avoid duplicate content, how to format your posts using semantic HTML, tips for cleaning up your code and more. </p>
]]></content:encoded>
			<wfw:commentRss>http://lifeonlars.com/seo/wordpress-seo-101-5-easy-steps-for-better-wp-seo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Remote blogging with the WP iphone app</title>
		<link>http://lifeonlars.com/wordpress/remote-blogging-with-the-wp-iphone-app/</link>
		<comments>http://lifeonlars.com/wordpress/remote-blogging-with-the-wp-iphone-app/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 11:58:53 +0000</pubDate>
		<dc:creator>larfa</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Remote Blogging]]></category>

		<guid isPermaLink="false">http://www.lifeonlars.com/wordpress/remote-blogging-with-the-wp-iphone-app</guid>
		<description><![CDATA[Having used WordPress on and off for a number of years and only recently jumped on the iPhone bandwagon it was more or less a given that I had to try the WordPress iPhone app. The app is very easy to setup and supports multiple WP blogs. Convenience for being able to blog wherever you [...]]]></description>
			<content:encoded><![CDATA[<p>Having used WordPress on and off for a number of years and only recently jumped on the iPhone bandwagon it was more or less a given that I had to try the WordPress iPhone app. The app is very easy to setup and supports multiple WP blogs.</p>
<p>Convenience for being able to blog wherever you are does however come at the cost of several core features. Realistically though I doubt you&#8217;ll be churning out novel length posts this way but it does have some uses for basic admin tasks and micro-blogging.</p>
<p><span id="more-99"></span></p>
<h3>Current limitations of the WordPress iPhone app</h3>
<p>If you are using themes that require custom fields for things like article thumbs then you won&#8217;t be able to seamlessly publish via the app. You could always write drafts for later publishing or for review by an editor if it&#8217;s a multi-author blog.</p>
<p>In its present form the app seems more suited for micro-blogging and can be quite useful if your blog automatically posts to Twitter. </p>
<h3>Remote admin and upkeep</h3>
<p>Probably the most useful feature for some people is the ability to to keep an eye on your blog remotely and be able stay on top of admin task like reviewing and approving comments. In the latest update of the app (version 2.2) you can now also reply to comments&#8230;wheee.</p>
<p>I&#8217;m sure future updates will add a lot more meat to the bones of this app, but for now we&#8217;ll have to be content with the rather meager framework that we&#8217;ve been given.</p>
]]></content:encoded>
			<wfw:commentRss>http://lifeonlars.com/wordpress/remote-blogging-with-the-wp-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ten things to do after you install WordPress</title>
		<link>http://lifeonlars.com/wordpress/ten-things-after-you-install-wordpress/</link>
		<comments>http://lifeonlars.com/wordpress/ten-things-after-you-install-wordpress/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 06:09:41 +0000</pubDate>
		<dc:creator>larfa</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Best Practice]]></category>
		<category><![CDATA[WP Tips]]></category>

		<guid isPermaLink="false">http://dev.wpcoder.com/dan/wordpress/?p=50</guid>
		<description><![CDATA[WordPress is a fantastic tool for anything from casual blogging to fully fledged CMS. If you are a designer and or developer using WordPress chances are you will be installing WordPress quite a few times but even if you&#8217;ve never installed WordPress before you&#8217;ll find this guide useful. If you&#8217;ve installed WordPress more than a [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress is a fantastic tool for anything from casual blogging to fully fledged CMS. If you are a designer and or developer using WordPress chances are you will be installing WordPress quite a few times but even if you&#8217;ve never installed WordPress before you&#8217;ll find this guide useful. </p>
<p>If you&#8217;ve installed WordPress more than a couple of times you would have noticed that there are few things that you always tend do with each WP install. Here are some of the first few steps you should consider doing after installing WordPress.</p>
<p><span id="more-94"></span></p>
<h3>First steps after a fresh WordPress install</h3>
<ol>
<li>Change your password, create new user and delete admin user</li>
<li>Change your blog tagline</li>
<li>Setup permalinks using %postname%</li>
<li>Change date and time format as well as timezone</li>
<li>Change media image sizes to suit your theme layout</li>
<li>Upload and activate your theme</li>
<li>Create your categories and set new default category</li>
<li>Install, activate and test your plugins</li>
<li>Configure RSS settings</li>
<li>Setup a backup for your WordPress database</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://lifeonlars.com/wordpress/ten-things-after-you-install-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

