Home > The power of the Elementor Display Conditions – tag based template

The power of the Elementor Display Conditions – tag based template

A no-plugin and no-code solution to hide or show stuff in your blog template

In the Global Elementor Community on Facebook, someone asked today: “Is there a way to hide empty Table Of Content with CSS?
Some of my posts have headlines, but the others do not.”

Steps to one of the easy ways to achieve that

  1. Create a tag in the WordPress Dashboard under posts, called “no headlines”.
  2. Create a duplicate of the blog template you have that Table of Content widget in, but leave out the TOC widget. I’d go for importing the original template in the new template and then simply remove the TOC widget from the new one.
  3. Upon saving that blog template, set display conditions to:
    Include: Singular, then choose under Post: “In Tag” and then, in the field that appears next to it, type the name of the tag you created, see screenshot below this steps list.
  4. Hit Save & Close.
  5. Open the post(s) that have no headlines and that don’t need the TOC widget, and in the sidebar on the right, under tags, type the first letters of your tag name. Autocomplete will show the full tag name. Select it.
  6. Save your post.
  7. Have a look at the front end. You will see that post now displays the template without the TOC widget.

Example of the settings

I use this same method for my footer. Every time I have a post that contains an affiliate link, I give it the tag I made for that purpose. Tadaaa, affiliate text footer appears under that blog post.
Settings for Elementor display condition based on a post tag, screenshot