Forums

change META descriptions for each post? (4 posts)

  1. JG99
    Member
    Posted 2 years ago #

    I tried using this code, but I got an error message. Do I need to delete something first from my header.php file?

    <meta name=”description” content=”<?php if (have_posts() && is_single() OR is_page()):while(have_posts()):the_post();
    $out_excerpt = str_replace(array(“\r\n”, “\r”, “\n”), “”, get_the_excerpt());
    echo apply_filters(‘the_excerpt_rss’, $out_excerpt);
    endwhile;
    elseif(is_category() OR is_tag()):
    if(is_category()):
    echo “Posts related to Category:
    “.ucfirst(single_cat_title(“”, FALSE));
    elseif(is_tag()):
    echo “Posts related to Tag:
    “.ucfirst(single_tag_title(“”, FALSE));
    endif;
    else: ?><?php bloginfo(‘description’) ?>
    <?php endif; ?>” />
  2. ben.blodgett
    Member
    Posted 2 years ago #

    I would not code meta information in your template, install All in One Seo http://wordpress.org/extend/plugins/all-in-one-seo-pack/ and edit meta information on the editor page for each post/page.

  3. katievanderdrift@hotmail.com
    Member
    Posted 2 years ago #

    I have all in one seo plugin installed and my meta descriptions aren’t showing up. Is there another way to assign meta descriptions to individual posts?-Thanks

  4. Mark / t31os
    Moderator
    Posted 2 years ago #

    Use the correct quotes and it might fix itself (as a suggestion)

    Get rid of these.

    “”

    And replace with.

    ""

Topic Closed

This topic has been closed to new replies.

About this Topic