Remove <p> tag from excerpt
-
It is annoying that the_excerpt() adds a <p> tag surrounding text or html, so I made a quick hack to remove them.:
<?php $myExcerpt = get_the_excerpt(); $tags = array("<p>", "</p>"); $myExcerpt = str_replace($tags, "", $myExcerpt); echo $myExcerpt; ?>
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Remove <p> tag from excerpt’ is closed to new replies.