Support Forum
Really? I will need to test that... I can just never remember the syntax for using shortcodes. I thought is was spaces...
For expediency I would suggest you go grab a plugin named WP Exec PHP from the WP plugin repository, activate it, go to the WP admin options for it and turn on the option to use in widgets - and then use the template tag in the widget.
Bit I will investigate the short code usage.
YELLOW
SWORDFISH
|
also, where were you using the shortcode? by defafult, wp does not process shortcodes in text widgets though you can enable it via a wp hook...
Visit Cruise Talk Central and Mr Papa's World
Sorry for the late reply. I was doing the shortcode like this
Sorry I've added the shortcode as an image as the syntax button keeps either making everything after this point code or the code disappears.
As a note the shortcode is missing from your new codex page:
https://simple-press.com/docum.....ot-topics/
Also did you have an answer as to how the rating is generated? And can it be changed if the customer wants?
Thanks
There is something odd about that codex page that will be investigated for sure. Thanks for pointing it out.
Sorry to hear you have problems with the syntax button as well. Not really sure why - we use it rather a lot without any problem. But you do need to select ONLY the text you want highlighted with care to make the best of it.
I am going to defer to Steve (Mr Papa) who wrote the tag on how the rating is generated. I have just looked at the code and even i am not sure what exactly is happening in there. Depending on the answer may decide on how easy it is to change so we need to wait for that first I am afraid.
YELLOW
SWORDFISH
|
First, in wp shortcodes camel case attributes are not allowed... they must be all lowercase...from http://codex.wordpress.org/Shortcode... and if you want to display a shortcode, but not have it processed, you can escape it, or use triple brackets around it, ie [[[ and ]]]... or [gallery] (note in wp posts its only two, but we need three in the forum because wp tries to run shortcodes on our stuff after we have already)
Looks like the codex page on that template tag, assuming by rating you still mean the sp_HotTopicsTag() function, is a bit weak since we normally list the filters available but that one does not...
anyways, you can use the 'sph_HotTopicTagScore' filter to replace the hotness equation with whatever you want... the default equation is:
log($days - $delta)
where $days is the argument (default = 30) you pass into the function for number of days to go back looking for posts and $delta is the number of days from current date to post date...
basically, your filter would need to return the value or score for the post... passed to your filter would be the post information and the arguments to the function...
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)