Hide category if there are no data attached

Support MB Views Hide category if there are no data attached

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #29259
    JamesJames
    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.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.