Hi,
Feel free to not worry about this one, as I am already doing what I need… but..
I am just wondering if there is probably a better way to do what I am doing.
I want to only show the little number of comments bubble on my home page slider images if there is at least one comment.
What I have done to achieve this is add in a conditional check in the get_comments routine inside td_module_slide.php and td_module.php,td_module_single_base.php (within wp booster) on get_comments_number($this->post->ID) – if it’s above 0, it will add it to $buffy..
Would there be a more clean way to do this?
-
This topic was modified 10 years by
jsup.
would you please paste the altered function get_comments() ?
thanks in advance
In the versions I have been running with, I just added an extra line and a check – you could probably achieve this more “cleanly”, but here’s my modification (I added in $GCN to store the number of comments, then I tested for it being greater than 0 – fairly straightforward I thought):
**UNFORTUNATELY – This editor stripped some code from the sample. I can’t post the code here 🙁
This would need to be replaced in the following files (from memory – I haven’t looked since June):
~/includes/modules/td_module_slide.php
~/includes/wp_booster/td_module.php
~/includes/wp_booster/td_module_single_base.php
Of course, if you have not set up a child theme, you will lose these changes upon next update.
NOTE: The sample code above is provided as is and there is warranty on its performance or effectiveness. Use this code at your own risk. If you are not sure what you are doing, don’t do it. The code may reference a version of the theme that is different to yours. Always compare the code with your existing code before replacing anything.
-
This reply was modified 9 years by
jsup.
Hi
You can also use http://pastebin.com/ to share your code here.
Thanks!