Viewing 2 replies - 1 through 2 (of 2 total)
  • For shortcodes in taxonomy descriptions add something like this to functions.php

    function my_term_description( $value, $term_id, $taxonomy, $context ) {
    	if ( !is_admin() ) {
    		if ( $taxonomy == 'your-taxonomy-slug' ) {
    			$value = do_shortcode( $value );
    		}
    	}
    	return $value;
    }
    add_filter( 'term_description', 'my_term_description', 10, 4 );

    For shortcodes in category description replace 'your-taxonomy-slug' with 'category', for shortcodes in tag description replace 'your-taxonomy-slug' with 'post_tag'.

    Thread Starter BlackSheep42

    (@blacksheep42)

    Many thanks for that.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Shortcodes’ is closed to new replies.