Portfolio Filter Query String for "All"

Hi guys -
I’ve used the techniques in Josh Donnelly’s YT video (https://www.youtube.com/watch?v=611IwxrOz8E) to create a portfolio page with buttons to filter by category. So far it is working properly except for one thing. How do I get it to show All categories? I want all portfolio items, regardless of category, to display when the page is initially loaded, and also if the user clicks the “All” button.

My page is https://staging.patrickandcompany.com/brands/ (current category fallback is “home”)

My query string is
post_type=x-portfolio&post_status=publish&ignore_sticky_posts=1&orderby=rand&order=asc&tax_query%5B0%5D%5Btaxonomy%5D=portfolio-category&tax_query%5B0%5D%5Bfield%5D=slug&tax_query%5B0%5D%5Bterms%5D={{dc:url:param key=“category” fallback=“home”}}&tax_query%5B0%5D%5Boperator%5D=IN

Is there something I can put in for fallback that will give me everything?
Thanks!

Hello @HoodSiegal,

Thanks for writing in!

You can create two loops. One is using the current Looper Provider Query String and the second one will just be using the Query Builder that displays all the posts. You can show or hide the Loop by utilizing the condition {{dc:url:param key=“category” fallback=“home”}} is/is not “home”.

This means that when the user clicks the filter buttons, the current looper will display. When the user clicks the “All” button or when you first load the page, the other Looper will be displayed. If this does not make any sense, please provide us access to your site so that we can help you set the Loopers. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
- Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

Best Regards.

This worked beautifully - thanks!
For anyone else following this, I had trouble when I copy/pasted the condition above, but it worked when I retyped it, so I must have captured a special character or something. I also used a fallback of “all” and is/is not “all”.

Hi @HoodSiegal,

Glad that we are able to help you.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.