WordPress.org

Ready to get started?Download WordPress

Forums

Unique Meta Descriptions for Navigation Pages - Not Working (2 posts)

  1. tankard
    Member
    Posted 2 years ago #

    Hi,

    I'm trying to solve the age-old SEO issue when you have duplicate meta descriptions for all paged views. For example, yourdomain/page/2/ will have the same meta description as yourdomain/page/14/

    Considering, I don't have that many pages in my navigation, I tried adding this to my template header:

    <?php if ( is_home() || is_front_page()) : ?>
    &nbsp;
    <?php elseif ( $paged == 2 || $page == 2 ) : ?>
    <meta name="description" content="This is the home description number two."/>
    <?php elseif ( $paged == 3 || $page== 3 ) : ?>
    <meta name="description" content="This is the home description number three."/>
    <?php elseif ( $paged == 4 || $page== 4 ) : ?>
    <meta name="description" content="This is the home description number four."/>
    <?php else : ?>
    <meta name="description" content="This is some generic description."/>
    <?php endif; ?>

    It works on my test installation, which has a very simple theme installed. All other blogs with more advanced themes (and I tried many, many blogs) are not working and I don't have a clue why. Obviously it's because of the theme, otherwise, why would it work with that simple theme?

    The errors depend on the theme but in most cases it will display the   thinking that we're still on the homepage, regardless which navigation page you're on. Or, it will correctly detect the homepage, display the correct description on page 2 and then just crash and load the "generic" description even on pages 3 and 4.

    Oh, and I've tried $paged and $page variables on their own - not making any difference.

    Please tell me why! :)

  2. tankard
    Member
    Posted 2 years ago #

    Bump!

Topic Closed

This topic has been closed to new replies.

About this Topic