Hacking header code to allow unique title tags on post pages only (1 post)

  1. billiardsblogger
    Posted 9 years ago #

    Hey everyone,
    I use a plugin called SEO Meta Editor to rename my title/description/keyword tags. This plugin allows me to set these fields when I create a post. I pasted and bolded the code that this plugin requires that I place in my header file at the bottom of this post.

    Problem is that I only want this renaming to happen on post pages - not the homepage. I assume I want to use some sort of conditional tag (is_home maybe) to say that this renaming process should not affect the homepage.

    I would like to find a way to define these tags for the homepage once - then have this plugin do the same for all post pages. Any advice would be GREATLY appreciated.
    Thanks in advance

    To see the site where this is occuring: http://www.billiardsblogger.com

    global $wp_query, $post;
    $meta_description=get_post_meta($post->ID, "html_meta_description",true);
    $meta_keywords=get_post_meta($post->ID, "html_meta_keywords", true);
    $meta_title=get_post_meta($post->ID, "html_meta_title", true);

    print '<meta name="Keywords" content="'.$meta_keywords.'" />';
    print '<meta name="Description" content="'.$meta_description.'" />';
    print "<title>$meta_title</title>";

    <?php if(is_home()) { bloginfo('title'); echo ' - '; bloginfo('description'); } else { wp_title(''); echo ' - '; bloginfo('name'); } ?>

    /*For Reference - here is the URL of the plugin Readme.

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 9 years ago by billiardsblogger
  • This topic is not resolved
  • WordPress version: 2.1.1