Support Forum

Sponsor's 2nd Post?

AM Andrew Mason
Andrew Mason
Member

Is there a “Sponsor’s 2nd post” option? Are you guys familiar with this feature? Have you looked into it or considered it?

5 Answers

New Answer

MP Mr Papa
Mr Papa
Member

No, afraid I dont know what that means… can you elaborate?

MP Mr Papa
Mr Papa
Member

you can do it already… in your theme, where you loop through the posts, you can check if second post and output an ad… search these forums for inserting ads or text links.. concept the same… come on back if you still having trouble after searching… we can help more or point to right posts…

AM Andrew Mason
Andrew Mason
Member

Are you talking about going to “Themes” in the admin and then going to “Theme Editor” and editing the php file?

If not, I’m not sure what you mean by “loop through the posts.”

MP Mr Papa
Mr Papa
Member

just like a wp theme and its template files with a loop, simple press themes have a loop… the loop varies depending on which page type (ie group, forum, topic, etc) that you are on…

so for viewing a topic (list of posts), your template file is the spTopicView.php template file in the sp theme your are using… just like in a wp theme, you will see the loop:

if (sp_has_posts()) : while (sp_loop_posts()) : sp_the_post();

that iterates over all the posts for that page in the topic… so you can check if post is number two:

if ($spThisPost->post_index == 2) { # output your ad here }

and you should be all set… just put the check in the loop, where you want it to show…

also, as always we strongly recommend you create your own the in case of editing ours or you will lose changes on updates to the theme… see:

http://codex.simple-press.com/codex/themes/theme-basics/creating-a-theme/