How to use CONDITIONS with Custom Post Types?

Hey,

I recently switched from elementor to bricks and I’m building my first site in bricks.

My problem: I created a custom post type “job” with the free pods plugin. Now on my Landig Page I have two containers a container with posts that loads the job posts and a container(nojobs) with a text like “currently we dont have any open positions”.

I want to hide the jobs container if the custom post type “job” don’t have any jobs. But I can’t find any options to do it like this for example something like if job.amount > 0 show job container and on the other side for the nojob container if job.amount < 1 show no-jobs container.

Am I just blind and don’t see the options or does it need custom code?

You can use a wp_count_posts() function and hide the element if it returns 0.

Try this in your condition field:

{echo:wp_count_posts('job')}

And show or hide content if it equals to 0

1 Like

This works, thank you so much!

1 Like