Hi,
I set up a new CPT for events. Then I created an archive page for this CPT.
In the CPT there are different kind of events, like seminar, talks, and so on.
Now I want to have a menu entry for an archive page which shows only seminars. And then another menu entry for showing events which are talks, and so on.
I managed to get the archive page linked to my menu by using the URL. But now I can only access the archive page with on filter set (in the loop selection by a query). Is it possible to have more archive links with different filters?
Thanks
Alex
Hi, if I understand correctly you would like to add some custom links to your WordPress menu so the User can visit archives with specific filters predefined. Is that correct?
In the Archive's Query Filters panel, you should be able to set up a custom field filter or a custom taxonomy filter based on a URL parameter (see the attachments). I'm not clear from your details whether the Event type is defined in a custom field or in a custom taxonomy, but either case is filterable by URL parameter. That will display different results based on the link URL, something like these links:
https://yoursite.com/your-event-archive-url/?wpvchapternum=123
https://yoursite.com/your-event-archive-url/?wpvchapternum=234
https://yoursite.com/your-event-archive-url/?wpvchapternum=345
...
and so on. Different URL parameter values will produce different results in the archive when your Query Filter is set up to respond to a URL parameter. The parameter name 'wpvchapternum' here is arbitrary, and you must define one for each filter in the filter configurations. You can create any number of custom HTML menu items with links to these URLs with parameters predefined, as shown in the attachments here. Will this work for your needs, or am I misunderstanding what you want to accomplish?
Hi,
Thanks a lot. This sounds exactly like this I would do. I'll try it.
Give me a day to test it.
Thanks
Ok, it works very well and will be a good solution for me doing other things.
But in this case I unfortunately need different headings and introduction texts above the archive listing.
Therefore this solution will not work as I need.
Do I have it to do with a view?
Okay if I understand correctly you also want to display some information in the archive conditionally based on the URL params in the inbound archive link URLs. This seems like a separate issue, because it is not directly related to creating menu items with URL parameters. It's more related to responding to those link URL parameters in the archive and displaying specific content there conditionally. I'll split off a separate ticket to discuss in more detail. Let's focus on the menu items specifically in this ticket, and focus on the archive display in the new split ticket. If you're satisfied with the menu solution we've already discussed here for creating custom links, I think we can close out this ticket and continue our discussion in the new split ticket.
My issue is resolved now. Thank you for your great support.