This topic has 7 replies, 2 voices, and was last updated 8 years by sharmstr.

  • Author
  • #96683
     Klame
    Participant

    Hi,
    I have a lot of trouble with archives for categories and taxonomy..
    Let’s say i have a category called “Phones” And a subcategory called “Apple”, in my custom post called devices.

    As far as I know you are supposed to copy archive.php and name the file:
    category-phones.php, and another one called category-phones-apple.php

    Right?

    I have tried several different things, but I dont get any result at all. Only: It seems we can’t find what you’re looking for. Perhaps searching can help.

    What am I doing wrong? Does Kleo use require someting special?

    #96722
     sharmstr
    Moderator

    It depends on how you set it up. I know your title says ‘custom category’ but is that really a custom taxonomy are do you mean you’re actually using the built in WP categories in your cpt?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #96729
     Klame
    Participant

    Well, i’m guessing it’s the built-in categories. I have just added them in dashboard, if you go to “post” -> “categories” -> “add new” . Makes sense?
    I wrote custom, because I don’t use what came with Kleo theme.

    #96735
     sharmstr
    Moderator

    Yep that makes sense. CPTs dont show up in WP archives by default, even if you create a category template for them as you have. You have to tell WP to display them as well using pre_get_posts. http://premium.wpmudev.org/blog/add-custom-post-types-to-tags-and-categories-in-wordpress/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #96736
     sharmstr
    Moderator

    I should also mention, that by using pre_get_posts, there’s no need to create a category-xxx.php file either. You only need that if you plan to change the layout of that specific category.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #96737
     sharmstr
    Moderator

    Another thing I forgot. In the future when you have “is Kleo doing something special with xxx?” questions, you can always figure that out yourself by switching to the WP 2015 Theme to test your work. If it works there, but doesnt working in Kleo, then you know that Kleo requires something special in order for your customization to work.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #96739
     Klame
    Participant

    Beautiful! Seems to be working! At least with categories, haven’t tried with taxonomies.
    Thanks a lot!

    #96745
     sharmstr
    Moderator

    You’re welcome.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?