Hi, I’m using a modified version of the “Clinic” theme. It uses content template elements in the Blog page/archive. This works fine when there are blog posts present, but when there are no posts the page content is blank rather than showing the standard WordPress “Nothing Found” message.
Is there a way to bring that message back while still using the content templates? I tried to find a way to add a custom conditional message if no posts are found, but can’t get anything to work. Thanks in advance!
for for now, the best method is to create another Block Element to contain your custom No Post Founds message. You can use a Page Hero or any Hook element. Set the Display Rules to match those of your Content Template.
Make a note of its post ID ( in the Browser URL when editing the post ) and the ID of the content template.
Then use the following PHP snippet to hide your custom no post element when we have posts, and hide the content template when we don’t have post: