Jump to content


Photo

Categories are broken


  • Please log in to reply
17 replies to this topic

#1 shmokes

shmokes

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 26 August 2011 - 03:28 PM

I just noticed something really weird going on with my categories. Today I followed one of my category links and was surprised to find the page was totally empty. It's strange. The categories appear to be working. They appear in my categories list, and correctly indicate the number of posts in each category. But none showed up on the categories page. Here's where it gets even stranger. I took a trip to my permalink settings and hit the save button. I didn't make any changes. I just hit the save settings button. And now my categories links are doing exactly the opposite thing. I go to to a particular category page and instead of displaying only the posts from that category, every single post is displayed. Any ideas?

#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 26 August 2011 - 03:52 PM

Have you already tried deactivating your plugins?

#3 shmokes

shmokes

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 27 August 2011 - 03:50 PM

Deactivated every plugin . . . no dice. Though it did give one hint. The plugin that I suspected might be the problem is one called Easy Custom Content Types, which can be used to create and manage custom post types, custom taxonomies, and meta boxes. Disabling that plugin and that made the categories pages empty again (like they were before I clicked "save settings" on the permalink settings page. So, I can't really be sure that Easy Custom Content Types is the culprit--disabling the plugin doesn't solve my problem--but it does have some effect on my categories pages. On the other hand, all of my custom post types are associated with that plugin, and all of my posts are custom post types. So maybe it makes sense that all my content would disappear from the pages with that plugin deactivated, since the custom post types disappear when the plugin is not active (and reappear when it is reactivated).

#4 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 27 August 2011 - 04:03 PM

Can you please post a link to your site?

#5 shmokes

shmokes

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 27 August 2011 - 05:16 PM

Thanks for your help. My site is: http://bestkidipadapps.com

Here's a link to the Sesame category, which should have only one post in it:

http://bestkidipadap...ategory/sesame/

And here's a screenshot of my categories list, which correctly reports that the Sesame category should only contain a single post:

Posted Image

#6 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 27 August 2011 - 05:26 PM

Were the categories and their posts working fine when you first created them? Were there any other changes made recently? Any upgrade?

#7 shmokes

shmokes

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 27 August 2011 - 05:49 PM

Yeah, they were definitely working. I tested every single one just after making it (because I visited them to copy the url for a link I put in a table here: http://bestkidipadap...ook-app-reviews).

The only changes that I can think of making are a metric ton of code I added to the functions.php in Base to make custom posts show up in the main loop and to make custom templates for my custom posts. But I commented all that out just now and it didn't make a difference.

The only other change I can think of, which doesn't immediately strike me as relevant, is that I recently installed the plugin WordPress Backup (Blog Traffic Exchange), which worked initially, but shortly after I installed it I noticed that my time zone was set to some place in Europe (I'm in Chicago), so my WordPress time was way wrong. Immediately after fixing the time, that Backup plugin stopped working, giving me an "Error 500 - Internal Server Error" message. To me that doesn't seem likely to be related, but it is at least something else that is currently not functioning properly. I emailed the plugin author and just figured I'd uninstall the plugin and use something else if I didn't hear back.

#8 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 27 August 2011 - 06:05 PM

What happens when you click the save settings button in the permalink settings again? Does it revert back to the opposite?

#9 shmokes

shmokes

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 27 August 2011 - 08:28 PM

Upon further experimentation I think I'm getting a bit closer to identifying the problem. All of my posts were initially made using the default "post" post type. I have since created custom post types, so I got a plugin called "Post Type Switcher", with which I changed the post type of all my "posts" to the custom post type "books". Strangely, although in the admin screen all the appropriate category checkboxes are checked, and the categories list correctly reports the number of posts in each category, the post archive showed up as empty. Disabling the plugin had no effect, because the plugin just changes the 'post_type' property of the post (which, remains changed regardless of whether the plugin is activated or deactivated).

I used the plugin to change the post type of some of my books back to the default "post" post type, and that made the categories archives work properly again for those items. So I installed another plugin called Post Type Convertr to change all of my post types back to "post" and that cured everything. Well, cured everything except that I need them to be "Books", not "Posts". Converting them back into "Books" reintroduced the bad behavior.

I'm not really sure what the problem is, but I'm kind of hoping this info will make a lightbulb light up in someone's head who knows more about the inner-workings of WordPress and Platform.

#10 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 28 August 2011 - 03:12 PM

Hm, I'm not sure what could be the issue, but I'll flag for developer's attention so they can look over this post and see if they have any insight.

#11 shmokes

shmokes

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 29 August 2011 - 05:19 AM

Thanks catrina. I'll keep my fingers crossed. I've also emailed the developer of the plugin and just a few minutes ago sent him admin access to my site, so hopefully that will produce some answers. If so I'll post them here for reference.

#12 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 29 August 2011 - 10:47 PM

Do you have 'has_archive' enabled for your custom post types? To my knowledge, custom post types don't have the 'category' taxonomy attached to them by default.

#13 shmokes

shmokes

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 30 August 2011 - 09:18 AM

'has_archive' is enabled.

You're right about the category taxonomy not being attached by default. I followed these directions in the plugin documentation to enable the 'category' taxonomy for my custom post types:


Adding Default Category and Post Tags to Custom Post Types

To enable the default Category and / or Post Tags on a custom post type all you need to do is create a new custom taxonomy with the same name as the default taxonomies.

So, for example, if you wanted to add the default categories to your Books post type, you would first create a new custom taxonomy named "category", then attach it to the Books post type.

If you wanted to add the default Post Tags to your Books post type, you would create a new custom taxonomy called "post_tag", then attach it to the Books post type.

Note: the taxonomy labels can be anything you want, but the taxonomy names must be "category" and "post_tag". If you change either of the names, they will not work.

Once you have created the new taxonomies, all already created categories and tags will be available for your custom post type.


This worked, at least in terms of making the categories box, with all my previously made categories, appear in the sidebar of the edit screen for my custom posts.

#14 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 30 August 2011 - 10:53 PM

Can you use a custom taxonomy instead of 'category'? Or use tags?

#15 shmokes

shmokes

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 31 August 2011 - 06:34 PM

Presumably yes, but that leaves a bad taste in my mouth. It means something is broken on my site and I don't know why. More importantly, it most likely means that something I did broke my site and I don't know what that is to avoid it in the future. It could also be that what I'm seeing now is only a symptom of a much larger problem and taking care of it now would be far easier than taking care of it when I'm forced to sometime in the future. In short, if I have to I will just resign myself to the fact that my site is broken and there's nothing I can do about it. But that is a solution that I would like to avoid if at all possible.

#16 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 31 August 2011 - 06:44 PM

I've had great success with Platform and CustomPress to create custom taxonomies. Works perfectly.

#17 shmokes

shmokes

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 07 September 2011 - 03:24 PM

I verified that the plugin was the culprit. For what it's worth, though, after I brought the issue to the author's attention he patched the plugin and it seems to work correctly now.

#18 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 07 September 2011 - 06:21 PM

Many plugin authors don't update all the time when WP updates.