Site logo

Archived topic

Edit Category Pages with dynamic content

3 replies · Started by Roger on March 28, 2023

Viewing posts 1–4 of 4

I have edited the category pages using a Block element that uses a Query Loop that returns all the category posts.
How can I only show the category results from the block element and avoid showing the category created by default.
The idea is avoiding duplicated results and force that only show the ones created through the new created element block (or maybe should be a hook).

Thanks

Hi there,

1. Add new Block Element.
1.1 set the block element type in the editor to: Loop Template

https://docs.generatepress.com/article/block-element-loop-template/

1.2 Set the Display Rules to All Archives

2. In the editor add a GB Query Loop
2.1 Do not set any parameters
2.2 check the Inherit Query from Template

Now this one element will be used on all archives and the Query Loop will display posts that match the current query

It works fine David.
However, in the category pages now it does not show all the blogposts.
How can I create a pagination or retrieve all the category results?

Thanks :D

Edit the loop template, select the Query Loop block, in its Toolbar there is a button to Add Navigation.

This archived topic is closed to new replies.