Prepend query loop block | WordPress.org

[ad_1]

Is there a way to add a block before the query loop that displays only if the query has results? Essentially the reverse of the “no results” block.

The logic: I have a headline and a list of posts selected following a specific criteria. If no posts match the criteria, the headline is displayed with an optional “no posts found” text. Instead, I would prefer not to show the headline at all so that entire section just disappears from the page.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer