Site logo

Archived topic

blog section, query loop block element only on page 1

3 replies · Started by Javier on March 28, 2023

Viewing posts 1–4 of 4

Hello, created the blog with a query loop block, on the first page of the post, I created a block above this query, I wanted to know if you know of any way to hide this block on the following pages of the query "/blog/?query-page =2". So that this highlight does not appear again in the successive pages, I do not know if this is possible or if you know of any "trick" THANKS IN ADVANCE.

Hi Javier,

It's not possible using your current layout.

Are you using a block element - loop template for the blog?

If so, try the following steps:

1. create a new block element - page hero, and move the hero section into the page hero element.

2. in the loop template, select the query loop block and enable the inherit query from template option.

3. then you can use this filter to only display the block element - page hero on the first page of the archive:
https://docs.generatepress.com/article/generate_element_display/#display-an-element-to-the-first-page-of-archives-only

perfect, Ying, it worked for me, thanks for the speed.

Glad to hear that :)

This archived topic is closed to new replies.