If is use echo category_description() i show the correct category description, but wordpress insert <p> at the start of the string and at the end...
If is use echo category_description() i show the correct category description, but wordpress insert <p> at the start of the string and at the end...
One example:
<?php
//display category name/description for use in category template
if ( is_category() ) {
$cat = get_query_var('cat');
$category=get_category($cat);
echo '<p>Category Title/Name: '. $category->name . '</p>';
echo '<p>Category Description: '. $category->description . '</p>';
}
?>But i'm using category description in meta description, so i'm not interested show the <p> tag :(
echo $category->name;
or
$myvalue = $category->name;
Thanks, but why echo category_description()
return <p> tag ?
I'm looking for the same fix.
I want to edit whatever file generates category_description();
Add:
...remove_filter('term_description','wpautop'); in your theme's functions.php...
This is the link back to the support post I found.
LINK
This topic has been closed to new replies.