Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Last forum posts in a widget
Avatar
sptab
Member
sp_UserOfflineSmall Offline
Jun 29, 2012 - 4:12 am

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.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 29, 2012 - 9:01 am

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...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625