Use shortcodes in terms description?

Anyone knows a way of using shortcodes on terms description? This is possible?

Related posts

Leave a Reply

2 comments

  1. I believe the following should work:

    <?php
      $content = apply_filters('the_content', $content);
      $content = str_replace(']]>', ']]&gt;', $content);
    ?>
    

    You could put this in the template of in a hooked functions.

    I’ve cribbed this from here and here, where the intention is to write content from get_the_content() (raw) in an equivalent way to the_content() (amongst other things: parsed shortcodes).

    Good luck!

  2. I am not sure if it’s only code that is needed, but Hybrid has this filter mod for such:

    add_filter( 'term_description', 'do_shortcode' );
    

    If this doesn’t work I’ll try to go over code more thoroughly.