This must be pretty simple, but when I use the function below in header.php to grab the post excerpt to use a meta description for a single post or page
setup_postdata($post); $excerpt = get_the_excerpt(); echo $excerpt;
I end up with html entities for apostrophes, quotes, etc., like this:
<meta name="description" content="There&#8217;s an interesting thing going on in the world of digital music; it&#8217;s moving into the &#8220;cloud.&#8221; ...">
echo htmlentities($excerpt); and
echo html_entity_decode($excerpt); with no luck. How can I prevent those entities from showing up? I'm not using a function in functions.php to generate an excerpt.
This is kind of a workaround, as I have hundreds of posts that don't have a manual excerpt, and I think manual excerpts are immune to the entity issue, and that's why I am trying to use the standard excerpt.