WordPress.org

Ready to get started?Download WordPress

Forums

Eeplace text with category description (5 posts)

  1. studiosx
    Member
    Posted 3 months ago #

    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?

  2. esmi
    Forum Moderator
    Posted 3 months ago #

    What theme are you using? Where did you download it from?

  3. studiosx
    Member
    Posted 3 months ago #

    I use TwentyTwelve.

  4. esmi
    Forum Moderator
    Posted 3 months ago #

    Are you using a child theme?

  5. studiosx
    Member
    Posted 3 months ago #

    no

Reply

You must log in to post.

About this Topic