-
Author
-
January 6, 2016 at 18:15 #96683KlameParticipant
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.phpRight?
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?
January 6, 2016 at 19:49 #96722sharmstrModeratorIt 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
January 6, 2016 at 20:38 #96729KlameParticipantWell, 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.January 6, 2016 at 20:56 #96735sharmstrModeratorYep 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
January 6, 2016 at 20:57 #96736sharmstrModeratorI 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
January 6, 2016 at 20:59 #96737sharmstrModeratorAnother 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
January 6, 2016 at 21:23 #96739KlameParticipantBeautiful! Seems to be working! At least with categories, haven’t tried with taxonomies.
Thanks a lot!January 6, 2016 at 21:40 #96745sharmstrModeratorYou’re welcome.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.