Filter looper content with buttons

Hello, I’m trying to achieve what this user below achieved on his site. However, these instructions are a little more advanced than I’m able to follow. Can I get a step by step instruction on how to implement this feature to my site?

Again, my goal is to filter looper content with buttons. If there is a better way to do this, I’m open to any suggestions.

Thank you!

Hello Elisha,

Thanks for writing in!

I would highly recommend that you watch this video first:

Best Regards.

1 Like

Thank you so much. I’ll reach out again if I have any questions!

Hi Elisha,

You are most welcome.

Okay, this is going great. I was able to get this query string to work:

post_type=post&orderby={{dc:url:param key=“orderby” fallback=“title”}}&order={{dc:url:param key=“order” fallback=“asc”}}

& these on my buttons
?orderby=title&order=asc
?orderby=title&order=desc
?orderby=date&order=asc
?orderby=date&order=desc

I’ve tried a few different ways but how would I modify this string to filter by category name or slug; or their taxonomy name or slug? I’m not sure which param key goes where.

Thanks!

Update:
I tried these strings…

  1. post_type=post&orderby={{dc:url:param key=“catagory_name” fallback=“asc”}}&order={{dc:url:param key=“order” fallback=“title”}}

  2. post_type=post&orderby={{dc:url:param key=“catagory_name” fallback=“asc”}}

With these as my buttons:
?category=news&order=asc
?category=press_releases&order=asc
?category=blogs&order=asc

The reaction is ordering asc but the categories are not ordering as expected.

Hello Elisha,

You cannot use the category name as the order by parameter. Please check out this documentation first:

What you can do is filter the post by category using the category query. For example;

post_type=post&category_name=sample-category&orderby={{dc:url:param key="orderby" fallback="title"}}&order={{dc:url:param key="order" fallback="asc"}}

where sample-category is the name of the category.

Best Regards.

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