Remove quotes from excerpt
-
I have this code that calls the excerpt into a meta tag:
<meta name=”description” content=”<?php $words = explode(‘ ‘, get_the_excerpt());
echo implode(‘ ‘, array_slice($words, 0, 24)).’ …’; ?>” />The only problem is the excerpt that is called has quotes inside it that I don’t want (they break the meta tag).
How can I str_replace ” (quotes) within the excerpt, with say a Z?Maybe:
<meta name=”description” content=”<?php str_replace ‘”‘, ‘Z’; $words = explode(‘ ‘, get_the_excerpt());
echo implode(‘ ‘, array_slice($words, 0, 24)).’ …’; ?>” />The excerpt that is being called contains quotes (“) that I don’t want. Please help me str_replace them 🙂
Lou
- The topic ‘Remove quotes from excerpt’ is closed to new replies.