First I want to say thank you for sharing your custom sidebars plugin – Thank you!
I have one problem that took me awhile before I understood what was causing it. I have a website I am testing that is a classifieds site using custom post types.
For all main categories I have created a custom sidebar and have also checked the subcategories to use this sidebar as well. The Problem: When there is one ad in a subcategory, the master category count=2 and the subcategory the ad is in =2 while all other subcategories show an ad count =1, but there are no ads in them.
This problem is not specific to sidebars, but also in main content window (I’ll explain):
Parent categories on left side (+1 to count is added even if there are no ads)
When parent category (even subcategory) is click on the left then count is correct on left, but the sidebar displaying additional subcategories is not (+1 to count is added even if there are no ads).
I hope you understand and can help with correcting this issue.
EDIT—> The sidebars work great! It’s just the counts are off whenever I implement them. Also what I found interesting is if I disabled the plugin the category counts were still incorrect. In order to correct, I had to reactivate it then edit each sidebar and uncheck where it was to be displayed (ie main category & sub cats).
Thanks for the feedback. I am not sure what you mean about the “count”. Can you perhaps upload a screenshot to e.g. http://www.imgur.com and link to it here (or just send the screenshot to jv[at]intox.dk)?
I appreciate you getting back with me. I have emailed some screenshots of the problem.
I’ve had a look at the screenshots now. Can I get the name of the plugin you use for your ads?
I think I know what the problem is:
Content Aware Sidebars use the taxonomies and terms tables in the database to store checked terms (i.e. categories) for each sidebar. Now, the plugin you use for advertising counts the total stored terms no matter what post type is using them, thus the terms that the sidebars use are included.
Thanks again for getting back with me.
The plugin is called AdRotate. I suspected this as well, but when I disabled the ads in AdRotate and even disabled the plugin the counts were still off. Only when I unchecked where each custom sidebar was placed then sent it to trash did the counts come back correct.
If you deactivate Content Aware Sidebars, the sidebars and their settings remain in the database (in case you want to activate the plugin again). If you remove the plugin entirely, all used data is removed from the database.
I will have a look at the plugin when I get time, but I cannot promise an an effecient solution to your problem (both from this plugin’s point of view and AdRotate’s)
I understand Joachim and I do appreciate your time.
As mentioned in an email I deleted the AdRotate plugin and got the same issue I originally reported. Maybe it’s the theme I’m using.
Either way I edited out the counts for now so they are not displayed. If in the future there is a solution I’ll re-enable them. You’re plugin is awesome and I do appreciate you sharing it and your support.
What is the name of the plugin/theme that create these categories?
I’m having the same problem with category sidebars. It adds +1 to the category count. So all categories with zero posts show as having 1 posts. I’m using custom post types and custom taxonomy, and a custom taxonomy dropdown to filter by taxonomy.
I don’t think it’s a problem with cgatherings’s adrotate plugin. The taxonomy count is stored in the wp_term_taxonomy table in the count column. The count is the total in that taxonomy regardless of which post type is using it, but this has nothing to do with adrotate, this is just how WordPress natively counts terms in a taxonomy, and is used throughout the entire system. I don’t know how WordPress calculates this count in the first place, but the sidebars plugin is getting added to it. Sidebars would have to be re-engineered so that it used some other method of associating itself with a category, or at least subtract itself from the count of total posts associated with that term.
Was posting the solution but I then I noticed tons of bugs in the code…
I did realize that the issue is not in AdRotate, but that it lies in the way WordPress saves and counts terms in the database. Saving the terms as postmeta for the sidebars instead will solve the problem, and this method is being tested for future releases.
I think this ticket is related to the problem: http://core.trac.wordpress.org/ticket/5809
- The topic ‘CA Sidebars plugin alters main sub category counts’ is closed to new replies.