Home > OS >  Hide an element if there are no posts in a category
Hide an element if there are no posts in a category

Time:10-10

Using Elementor in Wordpress to style a Website. A complete row gets the ID "newsticker" - there are posts from category newspicker displayed.

I want to hide this complete row (display: none) when there are no posts in this category. How is this possible, using the $get_terms function does not help :/

CodePudding user response:

You can hide the row in the Advanced tab -> Responsive dropdown -> Hide in all devices - desktop, tab, and mobile, in elementor. Or you can delete that row if it is useless. :)

CodePudding user response:

If you can add style to your codes you can add a some style like below but it works only when your element is fully empty like this .<div ></div>

.row:empty{
display: none;
}
  • Related