Support Forum

How to remove the word "topic" in newest topics tag PHP raw code?

RL Robert Lawrence
Robert Lawrence
Member

Hi, I am using the php code below to show the recent topics in my forum and the word “topic” is showing before each topic.  How do I exclude this word “topic” and have nothing show up before each item.

 

<?php sp_NewestTopicsTag(
‘itemOrder=T&&limit=10&afterDate=<hr/>’
);?>
 
 

21 Answers

New Answer

RL Robert Lawrence
Robert Lawrence
Member

This forum is not letting me past in the raw code and keeps making it look weird.    Basically, I just want to know how to remove the word “topic” from the recent forum topics list and show just the title with links to the topics. 

You can see the page reference this here: http://codex.simple-press.com/codex/plugins/our-plugins/the-template-tags-plugin/template-tag-newest-topics/

RL Robert Lawrence
Robert Lawrence
Member
<!–?php sp_NewestTopicsTag(‘itemOrder=FTAUD&&limit=10&afterDate=<hr?–>I know this can be easily done using the recent posts widget but I am creating a static page and need to embed the last 10 recent topics using php code (without the word "topic" showing before each item.

I tried again to paste code in this message to show you but it’s getting all jumbled up and won’t let me.

 

BR Brandon
Brandon
Member

You would use the “beforeTopic” argument with nothing after the equals sign. The default is “Topic”

So something like:  itemOrder=FTAUD&limit=10&beforeTopic=&afterDate=<hr />

Also in your post above, although it’s jumbled, I am seeing 2 ampersands in a row && before limit. It should only be one.

 

MP Mr Papa
Mr Papa
Member

to enter code,  paste the code, highlight it, and use the code highlight button… looks like ${}

RL Robert Lawrence
Robert Lawrence
Member

 

This is what I have, and it is still showing the word “Topic” before each line.  Also, it is just showing 5 items and not 10 as I set my limit to.  Not sure what’s going on here.  Something is not right with my code or maybe the tag is not functioning properly?

<?php
 sp_NewestTopicsTag('itemOrder=T&limit=10&beforeTopic=&afterDate=<hr/>');
?>
RL Robert Lawrence
Robert Lawrence
Member

 

<?php
 sp_NewestTopicsTag('itemOrder=T&limit=10&beforeTopic=&afterDate=<hr/>');
?>
RL Robert Lawrence
Robert Lawrence
Member

Ok the past code thing isn’t working for me.  Keeps jumbling up the php open and closing brackets but the middle is what I have.

MP Mr Papa
Mr Papa
Member

please follow the directions I gave you before…

paste your code into the post highlight the code you just pasted go to the code highlight button – looks like ${}

it will maintain the code formatting…

RL Robert Lawrence
Robert Lawrence
Member

 

<?php sp_NewestTopicsTag('itemOrder=T&limit=10&beforeTopic=&afterDate=');?>
BR Brandon
Brandon
Member

From what I can tell that code looks correct. It makes me wonder if there is a caching plugin on your site that is showing old info and not new changes. If you are running a caching plugin then I would suggest turning it off while making these changes. I ran a quick check test and beforeTopic= nothing did remove the default ‘Topic’ text.

RL Robert Lawrence
Robert Lawrence
Member

The caching is all turned off and I cleared cache in the browsers and also at the webhost and still the same issue. 

The “topic” word is still showing up and the number of entries is still 5 and won’t increase to 10 even though I set it at 10 and have plenty of new topics posted to fill up that. So something with the code is not working properly or what I am using isn’t formatted right because it’s not pulling in 10 items and not getting rid of the word “topic”.

Not sure what’s going on.  Maybe if you give me some sample code, I can try that?  Any other possibilities what it could be?

YS Yellow Swordfish
Yellow Swordfish
Member

This – which is basically the same as you posted – works fine for me:

<?php sp_NewestTopicsTag('itemOrder=T&limit=10&beforeTopic=&afterDate='); ?>

Your problem – at least as far as that code you posted – is that the ampersands – the delimiters between each argument – had been converted to their HTML entity. If you didn’t do that then it is probably a problem with the editor you are using.

RL Robert Lawrence
Robert Lawrence
Member

Yeah I noticed that as well after I cut and pasted the code.  I tried your code and I am still getting the same thing.  The word “topic” is still showing up and only 5 items are showing.  I cleared cache and tried a few different browsers and the issue still is there.  So it makes me think something isn’t configured right in the plugin?  Or maybe a theme issue?

MP Mr Papa
Mr Papa
Member

do you have link to site??

and you dont still have an older template tag somewhere else do you?

this wont have anything to do with theme since its outside the sp theme…  you put in sidebar or other page, right?