Wordpress : how to allow PHP in tag or category description?

261 views Asked by At

(Sorry for my bad english, I'm french)

I would like to add PHP code in category/tags description field (Wordpress). What can I add in my functions.php file ?

In fact, I would like to run shortcodes inside this field. So I put this code in my functions.php :

add_filter( 'term_description', 'shortcode_unautop' );
add_filter( 'term_description', 'do_shortcode' );
remove_filter( 'pre_term_description', 'wp_filter_kses' );
remove_filter( 'term_description', 'wp_kses_data' ); 

It works with some shortcodes, but not all. So I would like to try this :

<?php echo do_shortcode('[myshortcode]'); ?>

But PHP can't run in description field of category and tag pages.

Thank you very much for your help

0

There are 0 answers