Layout Query to filter by post category

Playing around with the layout builder. I created a layout which shows the current blog posts and has a sidebar on the side with the blog categories. This is assigned to show when blog posts are being viewed. I used Query Builder to get it to display the blog posts, but I can’t figure out how to have it show just the posts from that category when I click on the link in the sidebar. It just shows all the blog posts.

I’m sure this is something that can be handled with Query String, I’m just not sure what to put there to accomplish this. I looked through some of the posts here and found this from another threadpost_type=“post”&category_name={{dc:url:param key=“category” fallback=“all”}} which looks like it should work to filter the category by the current category, but it still just shows them all.

Any help would be appreciated!

Hello @AdsMedia,

Thanks for posting in!

If you are using the Layout Builder’s archive layout, you do not need have a Looper Provider. All you need to have a Looper Consumer which will consume the data from the default WordPress archive loop. In the blog index, the Looper Consumer will return all the latest post items and in a specific category archive, the Looper Consumer will return all related post items on that particular category.

If you still have some difficulties in setting up your custom archive layout, please provide us access to your site so we can check it. 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.

Thanks, attaching the information for you.

Hello @adsmedia,

I tried to access your site dashboard but the default WordPress login URL which is www.example.com/wp-admin/ or www.example.com/wp-login.php not working it is taking me to the page not found page. In case you have customized the login URL please share it so that we can check it at our end.

Thanks

My bad, note updated with correct login URL

Hey @adsmedia,

As my colleague said, if you are using Archive Layout Builder, you don’t need to add any Looper Provider because it will automatically consume the data from the default WordPress archive loop. I also want to tackle that if the Looper Provider is enabled in the Archive Layout Builder, the pagination functionality will not work. That being said, I suggest that you disable the Looper Provider in your Column 2 > Row 1 and Column 2 > Row 1 > Column 1 > Grid 1.

image

Hope that helps.

Ok I see how that works! Thanks! Found the pagination element.

Hello @adsmedia,

Glad that we were able to help you please feel free to open a new thread if you have any more concerns.

Thanks

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