Custom Fields
Re-Envisioned
Support MB Views Hide category if there are no data attached

  • This topic has 0 replies, 1 voice, and was last updated 1 month ago by Kirb.
  • Creator
    Topic
  • #29259
    Kirb
    Participant

    Hi, how can I hide the category name/term name if there no data inside it?

    {% set terms = mb.get_terms( { taxonomy: 'dish-category' } ) %}
    {% for term in terms %}
    <li><a href="javascript:void(0);" data-store-id="{{ post.ID }}" data-id="{{ mb.esc_attr( term.term_id ) }}" class="nm-item getdishes">{{ mb.esc_html( term.name ) }}</a></li>
    {% endfor %}

    Thank you.

  • You must be logged in to reply to this topic.