Support Forum

Check if user is on topic page

JS Jakob Smith
Jakob Smith
Member

In my theme, I have moved the topic RSS button to the footer file, next to the all RSS button.

Now, I would like to have it shown only on topic pages. Probably using an if check in the footer file.

Is there anything like is_sp_topic_page() that I can use?

6 Answers

New Answer

JS Jakob Smith
Jakob Smith
Member

I just found sp_is_topicview() and it’s working for me:

if ( sp_is_topicview() ) { sp_TopicHeaderRSSButton('tagClass=spButton spLeft', __sp('Topic RSS'), __sp('Subscribe to the RSS feed for this topic')); }
            else { echo ""; };
MP Mr Papa
Mr Papa
Member

actually, I am bit confused as to what you are trying to do… we only show the topic RSS button on topic view page already…

or was that just an example???

JS Jakob Smith
Jakob Smith
Member

Well, I just wanted the topic RSS button to be in another place. On topic views I only wanted the “Answer” button in the area where the topic RSS button resided.

So, I’m editing the theme template files. They are very nicely laid out and easy to edit.

When this installation goes live, I will post a link. It’s a migration from bbPress 2.0.

Edit: I have put the code above in spFoot.php

YS Yellow Swordfish
Yellow Swordfish
Member

Looks like you did the right thing and used the right function. And we are always keen to see sites – especially when some customisation has taken place. So look forward to that.

MP Mr Papa
Mr Papa
Member

yeah, my only point was if the rss template call was in spTopicView.php, the check is redundant…  at least for the code you showed…

but like Andy anxious to see some customization!  cant wait!  holler if you have any more questions..