• Resolved jrcollins

    (@jrcollins)


    I am using the following php code for my meta descriptions and it seems to be working ok except I added a manual excerpt for one of my posts and for that post the meta description is still a dynamically generated excerpt.

    <?php if (is_single()) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
            <meta name="description" content="<?php the_excerpt(); ?>" />
            <?php endwhile; endif; elseif(is_home()) : ?>
            <meta name="description" content="my meta description for my home page here" />
            <?php endif; ?>
  • The topic ‘meta description php code’ is closed to new replies.