I have a taxonomy that I have created an archive template for in Bricks.
Before rewriting the taxonomy slug the template works fine. After rewrite the template doesn’t load and instead I get the 404 page as its looking for a page and not the template (presumably).
I have used term_link as in an example from the wordpress docs, similar to this:
FYI the code that is in the linked article throws an error if used as instructed by the post author. It looks like it was published in 2016 or earlier so might not work correctly with current PHP versions.
The article is useful and I should be able to glean the information that I need to fix this issue on my website. But maybe find a better article for future reference
So on further inspection and testing, the information on the page that you shared seems wildly inappropriate for this situation.
I set up the ‘request’ filter and output $query to a log file. I then loaded the taxonomy template by viewing a taxonomy and the $query object was simply:
…fails at several points. I can adapt the code to check that the array items are set but that then means that the variable $name is not set, which is referenced further down the function.
Can you give me some better insight in to how to make bricks recognise the new taxonomy slug that I set up using the ‘term_link’ filter, so that the taxonomy template loads instead of the 404 template? All I want is to change the taxonomy slug from fr-retreat-category/day-retreats/ to /day-retreats/ and have the taxonomy template that I have set up in Bricks to load for the new URL. The template works fine when tested without changing the slug with the ‘term_link’ filter.