Hi @ooohboi
Pods doesn’t really overwrite the archive.php template, it hooks into the Posts loop of an archive page.
If you need changes outside of the posts loop you’ll still have to edit the actual archive.php file!
Cheers, Jory
Pods doesn’t really overwrite the archive.php template, it hooks into the Posts loop of an archive page.
Yes I know it doesn’t, that’s not the problem.
My question was HOW it DOES?
I was able to “overwrite” the single post template without any problem bcoz Pods got hooked on “the_content()”.
But with the archive template it doesn’t do that on the_archive_description() nor the custom do_action() hook.
So the question is how things work with the “archive.php”, either the the_archive_description() or the custom hook?
The code example would be appreciated.
Thanks a lot for taking time on this one!
Hi @ooohboi
If the theme doesn’t provide a default action you can use for archives (eg: the_archive_description or something similar) you’ll have to add it yourself manually.
You can do this simply by adding the_archive_description() or do_action( 'your_custom_action' ) where you want.
I always advice to create a childtheme first!
Cheers, Jory
But the problem IS that neither of these two work Jory!!!
“the_archive_description()” doesn’t get replaced at all with my auto template.
As a side note, I have some WP experience (8 years), I’ve made some plugins and themes so I’m not a total noob.
Could you post the simplest possible “archive.php” code here?
Maybe I’m missing something obvious with regards to the Pod settings but I’m trying to figure out the logic behind it for over a week.
Thanks!!!
Hi @ooohboi
I’m very sorry but it seems you’ve stumbled on a bug!
Not only that, an already reported but after I searched for one.
Bug report: https://github.com/pods-framework/pods/issues/6368
I also just created a patch to fix it! I you could apply it and let me know if it also works for you that would be great!
Pull request: https://github.com/pods-framework/pods/pull/6490
Cheers, Jory
OMG! That was a real nightmare buddy, I thought I was losing my mind…
YES, I can confirm that the patch works now! Please push it with the next update.
Thank you very much for understanding!!!
Hi @ooohboi
I’m sorry to put you through that! I honestly though this was “just working” as I remember creating this. However, since that feature there have been several patches for other bugs and one of those must have caused this one without me realizing.
The next release will contain this fix! It’s already merged into the code 🙂
Cheers, Jory