Allow shortcodes in category pages

Posted in: Newspaper
Post count: 4

Hello,

There is a solution to add shortcode to a category page on description ?

It’s not working, even when i add add_filter( ‘category_description’, ‘do_shortcode’ ); to functions.php.

Thank you,
Best regards,

Post count: 6600

Hi,

Add the do_shortcode function to the category description variable like this: http://screencast.com/t/C9mIcDfS6

Thanks

Post count: 4

Thank you Lucian. That’s what i want, it’s working.

Regards

Post count: 13

@Lucian
Could you explain, where exactly place add add_filter( ‘category_description’, ‘do_shortcode’ ); in the file you describe?
I need the shortcodes to pimp my category description, but unfortunately I am not a PHP specialist…

Thank you in advance.

Post count: 6600

Hi,

You don’t need to add that filter.
Just add this code: http://pastebin.com/FweufJa9 to the page-category-slider.php file like this: http://screencast.com/t/JrYFkGsbK

Thanks

Post count: 13

@Lucian
This worked perfectly.

Thank you very much Lucian!

Post count: 4

Hi Lucian,

I just upgraded to Newsletter v6 and I couldn’t find the right place to tweak the code so that the shortcodes are working in the category description again. Could you maybe update your solution so that it works in v6? That would really be much appreciated.

Edit: I just answered my own question. Found the right place to change in includes/wp_booster/td_category_template.php. There change line 175 to

return '<div class="td-category-description"><p>' . do_shortcode($this->current_category_obj->description) . '</p></div>';

Thanks & best,
Torge

  • This reply was modified 10 years by Torge.
Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newspaper’ is closed to new topics and replies.