[Resolved] blog section, query loop block element only on page 1

Home Forums Support [Resolved] blog section, query loop block element only on page 1

Home Forums Support blog section, query loop block element only on page 1

  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by Ying.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2586197
    Javier

    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.

    #2586270
    Ying
    Staff
    Customer Support

    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

    #2586871
    Javier

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

    #2587521
    Ying
    Staff
    Customer Support

    Glad to hear that 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.