Original question
HIDE ELEMENT INSIDE QUERY LOOP IF PARENT TERM HAS NO CHILDREN
I have a query loop setup on my home page to show a grid of parent terms for a specific taxonomy.
Nested inside that query loop is a second query loop that lists the children of those parent terms. I have these children nested inside of an accordion element where users can expand and see sub items.
<container>
<query block>
<parent item> </>
<accordion>
<child query item> </>
</accordion>
</query block>
</container>
Preview

BricksUltimate add-on has an element condition {term_has_children:ENTER-TAXONOMY-NAME}. With this dynamic tag, you can check if the term has children or not.
In the above example, I used this condition logic {term_has_children:product_cat}. product_cat is the taxonomy name. You will replace it with your own taxonomy name.