Remove p tag from get_the_excerpt

Adding this PHP code to your wordpress theme will remove the <p> added by default to get_the_excerpt() functions.You can echo WordPress’ great function get_the_excerpt that returns the value to output the data like so:

 

 

<?php
$excerpt = strip_tags(get_the_excerpt());
echo $excerpt;
?>

Be Sociable, Share!

Leave a comment