This members-only tutorial provides the code to add a custom condition in Oxygen to ensure that element(s) to which the condition is applied to will only be output when the specified post type has at least one published post.

Use Case Example: You have a Section containing a "Testimonials" heading and a bunch of testimonial CPT entries using Easy Posts component below it. Now you want to ensure that this Section appears only when there is at least 1 published testimonial.

Simply add the code below as a Code Snippet and apply the condition.

Go to Snippets > Add New.

Title: Condition: CPT Has Published Entry?


This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $399 one-time).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?


Find the article helpful and wish to donate?



You need to be logged in to view and post comments.
Not a member yet? Join here.
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: