February 15, 2019, 11:41am
I have a custom post type called
service and an associated controller for archives. I’ve done this many times on other projects, but it’s not happening on this one.
Here’s what I have:
content-single-service.blade.php (partial for
Everything works as expected apart from the
archive-service controller. I’ve also tested specific taxonomy templates and controllers and they work as expected.
I am missing something?
February 15, 2019, 1:19pm
from the docs…
archive-gallery.blade.php for customizing the archive page for a custom post type registered as
so presumably the template will be looking for
partials/content-service.blade.php unless you’ve changed anything?
however it seems like you’ve got a different problem than that, if it’s the controller that’s not working?
February 15, 2019, 1:47pm
I am on my phone so I can’t test anything but off the top of my head this may be a start: If by ”not working” you mean that the controller is not included at all, try changing the filename of the controller to ArchiveService.php and also make sure that there is a body css-class named ”archive-service-data” (at least I think that is what the body class should be).
Change this to
and ensure the class is named
February 15, 2019, 2:12pm
@codepuncher - I’ve already tried this - no joy.
The naming convention I’m using is sound (and works on other projects), the problem was me being a twonk and filtering out an essential
February 15, 2019, 2:15pm
This is the problem, I had a filter on the
<body> class that removed the all important
archive-service-data. Refined the filter and all is good.
Thank you so much - this was driving me insane, as I could see everything to do with the files was correct. Thank you!
FIX: the issue was self-inflicted - I had a filter on the body class that removed the
February 15, 2019, 2:17pm
@jmp909 - the problem was in a completely different place, as described here.
March 29, 2019, 11:42am
This topic was automatically closed after 42 days. New replies are no longer allowed.