Title: Query Loop with a Headline
Last modified: September 27, 2024

---

# Query Loop with a Headline

 *  [painlessseo](https://wordpress.org/support/users/painlessseo/)
 * (@painlessseo)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/query-loop-with-a-headline/)
 * Hi my awesome GP support,
 * I used the Query Loop to build a simple related posts and I set `Taxonomies =
   Categories` and `Select Terms = Current post terms` .
 * If the post doesn’t have any related posts, then, the **Query Loop block** won’t
   show. Perfect.
 * But, I also have a Headline block that says “You may also be interested in:” 
   like so:
   [https://ibb.co/J5B3jp2](https://ibb.co/J5B3jp2)The issue is that if
   the post doesn’t have any related posts, then, the **Headline** block still shows.
   Any suggestion that would not display it in this scenario?
 * Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Support [Alvind](https://wordpress.org/support/users/alvindcaesar/)
 * (@alvindcaesar)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/query-loop-with-a-headline/#post-18039907)
 * Hi there,
 * Refer to this topic:
   [https://generatepress.com/forums/topic/hide-block-element-with-query-loop-if-there-are-no-results/](https://generatepress.com/forums/topic/hide-block-element-with-query-loop-if-there-are-no-results/)
 *  Thread Starter [painlessseo](https://wordpress.org/support/users/painlessseo/)
 * (@painlessseo)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/query-loop-with-a-headline/#post-18040263)
 * Hi [@alvindcaesar](https://wordpress.org/support/users/alvindcaesar/) , thank
   you. Did you mean a structure like this
   `container (id=1)-query loop (id=2)-headline(
   id=3)
 * Can you please add the pseudo ids to the snippet for me? The getcloudapp link
   is no longer working, so I don’t really know what their f6030caa and 2aa41bb5
   refer to.
 * Thank you!
 *  Plugin Support [Alvind](https://wordpress.org/support/users/alvindcaesar/)
 * (@alvindcaesar)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/query-loop-with-a-headline/#post-18040288)
 * That’s the unique class ID of the element. If you can share the page where the
   Query Loop block is, I can help check it.
 *  Thread Starter [painlessseo](https://wordpress.org/support/users/painlessseo/)
 * (@painlessseo)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/query-loop-with-a-headline/#post-18041797)
 * Hi [@alvindcaesar](https://wordpress.org/support/users/alvindcaesar/) , thank
   you. I understand that those are the unique class IDs, so I added the pseudo 
   IDs for you.
 * `container (id=1)
   -query loop (id=2)-headline (id=3)
 * The site is in my local env and it’s not live yet. If you can add the pseudo 
   IDs to the snippet, it will be awesome so I can replace them with the real IDs
   and test in my local env.
 * Thank you!
 *  Plugin Support [Alvind](https://wordpress.org/support/users/alvindcaesar/)
 * (@alvindcaesar)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/query-loop-with-a-headline/#post-18042035)
 * The unique class ID needs to be obtained directly from the page using the browser
   inspector. So there’s no way for me to provide it if I can’t access the page.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Query Loop with a Headline’ is closed to new replies.

 * ![](https://ps.w.org/generateblocks/assets/icon.svg?rev=3239461)
 * [GenerateBlocks](https://wordpress.org/plugins/generateblocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/generateblocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/generateblocks/)
 * [Active Topics](https://wordpress.org/support/plugin/generateblocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/generateblocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/generateblocks/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Alvind](https://wordpress.org/support/users/alvindcaesar/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/query-loop-with-a-headline/#post-18042035)
 * Status: not resolved