Support » Plugins » Hacking header code to allow unique title tags on post pages only

  • 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:

    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.*/

  • The topic ‘Hacking header code to allow unique title tags on post pages only’ is closed to new replies.