-
aaronmckeon
Is it possible to easily filter an archive by various terms and/or post meta? If so, is it better to do it using an archive template or creating a page?
I have a custom post type
food-and-drink
that contains eating establishments and I need to be able to filter by cuisine (taxonomy), whether or not it allows pets (custom field), etc.Any advice on the best mechanism to do this would be appreciated.
-
Hi there,
I believe this plugin would be what you are looking for: https://wordpress.org/plugins/filter-everything/
Let me know if this helps 🙂
-
aaronmckeon
Okay, I installed that plugin and will give it a try. Looks promising. However, I still need to decide between two options for displaying posts:
— Option 1 – Create an archive that has the filters in it.
— Option 2 – Create a page that has the filters in it.It seems cleanest to do this as an archive, since it is an archive of all the posts in the
food-and-drink
post type. However, how do you setup the archive template in GenerateBlocks? The template (as I understand it) is only for the individual posts that display inside the archive. I would need to be able to update the template of the archive page itself so I can add the filter widget and style the page to my liking. Is this possible? Thanks.— Aaron
-
I don’t understand your requirement exactly but it’s probably best to do with by trial and errors.
I believe some users elect to go with a static page + GB’s Query Loop block + filter plugin for something like this.
-
aaronmckeon
Forgetting about the filters, I’m looking to customize the look and feel of the archive page beyond just customizing the individual posts in the loop. For example, I might want to put an image at the top, then a grid with two columns where I drop a short-code in the left column and the archive output of posts in the right column. I would need two elements (one for the individual posts in the loop, which I know how to do; and one for the main page). Is this possible or do I have to create a specific page instead of using native WordPress archives?
-
Based on your description above, I believe a Block Element Loop Template would be what you are looking for:
https://docs.generatepress.com/article/block-element-loop-template/ -
aaronmckeon
Thanks – That did the trick.
- You must be logged in to reply to this topic.