• JG99

    (@jg99)


    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; ?>” />
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘change META descriptions for each post?’ is closed to new replies.