I'm trying to get the excerpt to work as my page description it's working just fine apart from the <p></p> showing in the text, I want to have the page description done this way as it will speed up adding content and if any others forget to enter a description it will still work. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <meta name="description" content="<?php the_excerpt(); ?>" /> <?php endwhile; else: ?> <?php endif; ?> Code (markup):
We actually did a blog post on several different ways to do this, which you can find here: http://redrokk.com/2010/08/16/removing-p-tags-in-wordpress/ In this case the easiest way is to simple place <div>t ags around it. This will prevent WP form adding p tags because it already has a block in place. BTW: The code you have as an example has nothing to do with it. WP adding p tags is built into the core of Wordpress not the template files. You can also find plugins that will remove these for you on the Repo or maybe CodeCongo.com