Support » Plugin: Visual Term Description Editor » Displaying descriptions in a page template

  • Resolved fede.giro


    I’m tryjng to display the taxonomy descriptions in a page template loop.

    <?php $terms = get_terms('publicacion');
    foreach ($terms as $term) {
    $wpq = array ('taxonomy'=>'publicacion','term'=>$term->slug);
    $desc = $term->description;
    $myquery = new WP_Query ($wpq); { ?>
    <div class="red">
      <div class="post-content">
         <h2><a href="<?php echo home_url(); ?>/publicacion/<?php echo $term->slug ?>/"><?php echo $term->name ?></a></h2>
         <?php echo $desc; ?>
      <?php } ?>
    <?php } ?>

    Some of the descriptions i created with the Visual Term Description Editor plugin has h2 and ul tags. But ‘echo $term->description’ is stripping those tags from the description. Anybody know a way to prevent this? Thanks! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shea Bunge


    I’ve tested this out, and for me $term->description preserves the HTML tags. Perhaps this is specific the custom taxonomy? What is the actual output you are receiving?

    You could also try using the term_description() function:

    echo term_description( $term->term_id, 'publicacion' );

    i really appreciate your response. i deleted the content of the taxonomy editor and filled it again, and using the

    echo term_description( $term->term_id, 'publicacion' );

    it works now. 🙂
    thank you!

    Plugin Author Shea Bunge


    That’s great!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Displaying descriptions in a page template’ is closed to new replies.