-1

All the applicable code is in this gist.

I have a really simple category.php template. I have 3 posts, each belonging to the same parent category, and 2 belonging to one child category and the third belonging to the other child category.

When I use wp_list_categories to generate the category links, it works fine. But when I click the link to look at any of the categories, I get the else from the have_posts if statement.

3
  • 2
    Please post the problem code in your question as a reference, you can link to your debug output though.
    – Wyck
    Jul 9, 2013 at 0:49
  • are your posts of the type post and not a custom post type? what happens if you disable plugins and use a default theme?
    – Milo
    Jul 9, 2013 at 3:02
  • @Milo, good call on the custom post type.
    – nicjohnson
    Jul 9, 2013 at 17:53

1 Answer 1

1

OK, it turns out that a simple function on the pre_get_posts filter does the trick. The issue was that custom post types aren't included in the default query.

1
  • Could you share the function please? Thanks
    – ejntaylor
    Apr 20, 2016 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.