Support Forum

Last forum posts in a widget

SP sptab
sptab
Member

I’m building my own widget to display different “last forum posts” depending on the blog page I’m currently on.

I have tried to echo the last forum posts shortcode in my widget code, but it did nothing else than displaying the shortcode itself.

I’m not a WordPress expert and not sure on how to fix that, maybe it would be easier to call directly the SP function to display the last forum posts ? Any recommendation on that ?

Thanks.

1 Answer

New Answer

MP Mr Papa
Mr Papa
Member

every shortcode has a corresponding template tag… actually its the other way around, but not important… 😉

so depends on where you tried to do the shortcode…  in php code?  you would have to invoke it…  something like:

echo do_shortcode(‘‘);

 or to use shortcodes in text widgets, you might need:

add_filter(‘widget_text’, ‘do_shortcode’);

in your theme spFunctions.php file…