Forums › Forums › Search & Filter Pro › Category Description
- This topic has 17 replies, 2 voices, and was last updated 7 years, 4 months ago by Anonymous.
-
Trevor(Private) July 25, 2017 at 8:18 am #122566
It is my code creating the 1. D’oh
Replace this:
echo '<pre>',print_r($sf_current_query),'</pre>';
with this:
echo '<pre>',print_r($sf_current_query,true),'</pre>';
The reason is that the 1 is confirmation that a result was returned. This is because print_r does this by default if you echo it. Adding the true parameter stops it doing that.
I am unsure why your original adds the 1 though.
Anonymous(Private) July 26, 2017 at 10:01 pm #123028Yeah I just get the ID number printing after setting the filter so in my case 7 or 8.
I’ve added the ‘true’ in my echo statement now and it’s working as expected with no trimming of the 1 needed.
echo '<div class="cat-desc">' . category_description( $currentCat,true ) . '</div>';
Thanks for your help.
-
AuthorPosts