Return to Snippet

Revision: 18220
at September 23, 2009 16:05 by paulgrenwood


Initial Code
<?php $title = get_post_meta($post->ID, 'post-img', true);
if ($postimageurl) {
?>
      <title><?php echo $title; ?></title>
<?php } else { ?>
<title><?php wp_title(''); ?> | <?php bloginfo('name'); ?></title>

 <?php } ?>


//Then, you can create a custom field <title> and it’ll appear as your title! If no custom field is set then a blog-standard title is displayed.

Initial URL

                                

Initial Description
Search Engine Optimisation, or SEO is something that a lot of bloggers get obsessed about, whilst others think it’s a load of rubbish. I’m halfway between the two – whilst I believe that you can change certain things to better SEO your content, such as adding H1, H2 etc tags in the appropriate places, I personally don’t think you should get too carried away with it. One of the things you can do though is change your title tag, and this custom field trick will let you set a custom field and it’ll appear as your title tag. Add the code below to your header.php file:

Initial Title
Custom Fields - SEO Your Title Tag

Initial Tags
wordpress

Initial Language
PHP