(0) next to categories in popular post category widget?
This topic contains 11 replies, has 4 voices, and was last updated by Paolo 10 years, 11 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
July 27, 2014 at 5:53 pm #10097
What is the (0) next to categories in popular post category widget?
Is there a way to get rid of the (0) ?
Thanks!
July 27, 2014 at 7:12 pm #10098Hello, the 0 is the number of places in the given category (in your case, 0).
As far as I know it can be removed, unless it’s edited via code.
S.
July 27, 2014 at 7:13 pm #10099It’s not working then… No matter how many places I have in a category it always shows (0). I can click on the category and it will list all the places that are in that category only but still shows the number as 0.
Where is the code for this widget? I will have to manually remove that from the code. Even if it was showing the correct number I would not want that displayed.
Thanks
July 27, 2014 at 9:14 pm #10104And are their listings for that category in the Location you have browsed to?
If there are no listings at all in category (anywhere), then the category should not even be shown.July 28, 2014 at 12:47 pm #10133The categories have multiple listings in each one. Only categories that have listings are being shown but in all cases there is a (0) next each one.
Not sure why this started. I have not added any plugins before this started showing (0).Does anyone know where the exact code is that displays this (0) ? I would like to just get rid of it as I don’t want any counts next to the categories anyways.
Thanks.
July 28, 2014 at 12:54 pm #10134If I remember right, you are not using the location indicator.
Does the category count also show zero at yoursite.com/location ?
How do you know you are not in a location that has no listings for a particular category if you do not use the location switcher?A URL would be handy to check.
July 28, 2014 at 1:12 pm #10135I do not show any category counts at /location. Just the map.
for a location switcher I use the same method as the online demo for all locations. and this method works just fine for switching locations. See how it is done here:
http://wpgeo.directory/all-locations/I have made a screenshot clearly showing a listing (One of many) in the Restaurants category and the popular categories on the right showing (0) for that example category…
July 28, 2014 at 4:19 pm #10147Hi,
can you please provide links instead of Images (which are totally useless for us)?
Thanks,
July 28, 2014 at 4:30 pm #10148Site is not on a public server yet so I want at this time to change the code that displays this.
I am looking for someone to tell me where the code is that displays the (0) and then I will go remove it from my copy of the plugin. I am not interested in fixing it on my site as I don’t want even a correct number displayed.
I know that many free directory listing scripts have an option to not display the number listed so maybe this can be also done in the future?
But in the mean time, if someone would be so kind to point me to the block of code that displays this I can remove it from my copy.
Thanks for the help!
July 28, 2014 at 5:23 pm #10153Haven’t tested it, but should be:
geodirectory/geodirectory-widgets/geodirectory_popular_widget.php
line to be edited:
from
echo ucwords($cat->name).' (<span class="geodir_term_class geodir_link_span geodir_category_class_'.$post_type.'_'.$cat->term_id.'" >'.$total_post.'</span>) ';
to
echo ucwords($cat->name);
If you modify the plugin widget directly you will lose the changes after every new update.
The best thing to do, would be to copy the entire widget code and registration action. Copy the code in your theme functions.php file, rename the class and function name, modify the widget description and update the class name in the register_widget call.
At this point you will have your new popular post category widget in your theme and you can modify it as you wish without having to deal with plugin updates.
Thx
July 28, 2014 at 5:26 pm #10154Thanks much Paolo, that was exactly what I was looking for! 🙂
— Dave
July 28, 2014 at 5:50 pm #10158you’re welcome! 🙂
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket