• studiosx

    (@studiosx)


    Hi,

    I want to replace in post, a text (ex. ‘banner’) with the category description.

    For category description I use this code:

    $categories = get_the_category();
      	foreach($categories as $key => $category) {
        	$url = get_term_link((int)$category->term_id,'category');
        	$categories[$key] =
          	"<dd>{$category->category_description}</dd>";
      	}
      echo "<dl>\n" . implode("\n",$categories) . "\n</dl>";

    How can I do that?

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Eeplace text with category description’ is closed to new replies.