Support Forum

Template Tag Shortcode list

PS Paul Smith
Paul Smith
Member

Hi there,

I want to add SP template tag shortcode to a sidebar linking to the forum home page and maybe including some of the hot topics. What code do I use? Is there a list anywhere?

Paul

24 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

No list yet – we are still working on it – sorry!

You will need to install and activate the SP ‘Template Tags’ plugin which has them all in. (http://codex.simple-press.com/codex/plugins/using-plugins/)

If you look on our footer here you will see two being used. A ‘Hot Topics’ and a ‘Recent Posts’. These are available as standard WP style template tags; as ShortCodes and, in the case of Recent Posts, a Widget.

The short code for the hot topics one is ‘sp_hot_topics’. We can help you with the options etc., when you are ready…

PS Paul Smith
Paul Smith
Member

Yellow Swordfish said
No list yet – we are still working on it – sorry!

You will need to install and activate the SP ‘Template Tags’ plugin which has them all in. (http://codex.simple-press.com/codex/plugins/using-plugins/)

If you look on our footer here you will see two being used. A ‘Hot Topics’ and a ‘Recent Posts’. These are available as standard WP style template tags; as ShortCodes and, in the case of Recent Posts, a Widget.

The short code for the hot topics one is ‘sp_hot_topics’. We can help you with the options etc., when you are ready…

Thanks for the reply. I have installed the plugin already. I wanted to see what shortcodes are available so that I could decide which to use. I dodn’t want to bother anyone on the forum if there was a list of shortcodes I could refer to. Is there such a list?

YS Yellow Swordfish
Yellow Swordfish
Member

No as I said – no list yet. Sorry but sadly the codex is behind us – it is a matter of finding the time! But it is getting written up slowly.

You could take a look at the code. The file /template-tags/sp-template-tags-plugin.php does list all of the shortcodes and tags available (look for the ‘add_shortcode’ statements).

We are more than happy to explain any you may be interested in and to help you with using them.

PS Paul Smith
Paul Smith
Member

Thanks for the information so far. Can you help me out with the process of adding recent posts to a sidebar? I tried adding the hot topics shortcode to a text widget but that didn’t work, but adding the shortcode to a post did. What shortcodes work with a sidebar widget and how do I get them to work?

Paul

YS Yellow Swordfish
Yellow Swordfish
Member

I will need to ask Steve (Mr Papa) about the shortcode usage – who will be around later.

But if you want to use the Recent Posts tag why not just use the supplied SP widget – it uses the same code as the shortcode and tag. You will find it in your WP widgets admin panel.

MP Mr Papa
Mr Papa
Member

all the shortcodes work in the sidebar though they might not be ideal
for that. certainly the recent posts is just fine for that. make sure
they are outside of php tags. please post your entire content of that
particular sidebar widget so we can review.

MP Mr Papa
Mr Papa
Member

all the shortcodes work in the sidebar though they might not be ideal
for that. certainly the recent posts is just fine for that. make sure
they are outside of php tags. please post your entire content of that
particular sidebar widget so we can review.

PS Paul Smith
Paul Smith
Member

Mr Papa said
all the shortcodes work in the sidebar though they might not be ideal
for that. certainly the recent posts is just fine for that. make sure
they are outside of php tags. please post your entire content of that
particular sidebar widget so we can review.

I have to be honest, I don’t have a clue what I’m doing when it comes to adding the content to the sidebar widget. Can you give me an example of what the contents should look like in order to display “hot topics” for example?

PS Paul Smith
Paul Smith
Member

Yellow Swordfish said
I will need to ask Steve (Mr Papa) about the shortcode usage – who will be around later.

But if you want to use the Recent Posts tag why not just use the supplied SP widget – it uses the same code as the shortcode and tag. You will find it in your WP widgets admin panel.

The Recent Post widget is now up and running. Thanks for the suggestion.

PS Paul Smith
Paul Smith
Member

Mr Papa said
so all good then?

Getting there, but I would still like some advice on adding shortcode to a post, a page or a widget. Exactly how it should be formatted. Can you give me an example?

MP Mr Papa
Mr Papa
Member

whether in a post/page or text widget, just enter the shortcode… for hot topics it would be

[sp_hot_topics]

if you look at the template tags plugin, at the arguments for the template tag (or shortcode but easier to see on the tag) you can pass arguments.. for example to have 10 posts, you would do:

[sp_hot_topics limit=’10’]

VE veritasnoctis
veritasnoctis
Member

Yellow Swordfish said
No as I said – no list yet. Sorry but sadly the codex is behind us – it is a matter of finding the time! But it is getting written up slowly.

You could take a look at the code. The file /template-tags/sp-template-tags-plugin.php does list all of the shortcodes and tags available (look for the ‘add_shortcode’ statements).

We are more than happy to explain any you may be interested in and to help you with using them.

How are the shortcodes formatted?

I keep getting “The requested forum does not exist” messages when I try them.

For example, I’ve tried all of these variations and all of them bring up the forum page but do not display any recent posts — all display the above message.

[ sp_recent_posts ]

[sp_RecentPosts]

[sp_RecentPostsShortCode]

[sp_RecentPostsTag]

I added spaces to the first one so that it would show up in the forum.

YS Yellow Swordfish
Yellow Swordfish
Member

Please now see the Codex: http://codex.simple-press.com/codex/plugins/our-plugins/the-template-tags-plugin/