The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Get the terms - remove hyperlinks for empty terms only (2 posts)

  1. Ali
    Posted 3 years ago #

    Hey everyone,
    I'm hoping to get help here -
    I am showing a list of custom taxonomy "clients" list but want to remove "hyperlinks" from only those that does not have a post attached to it.

    so "hide_empty => true" will not work in this case. I want to list them all but only link those that have posts attached to them.

    here is my simple code so far -

    $args=array('hide_empty' => false,'hierarchical' => true);
    $terms = get_terms('clients',$args);
    echo '<ul id="column" class="span4">';
    if (!empty($terms)){
    foreach ($terms as $term) {
    echo '
    <li><a>slug, 'clients').'">'.$term->name.'</a></li>

    thanks so much for your help.

  2. Ali
    Posted 3 years ago #

    Can anyone help with this?

Topic Closed

This topic has been closed to new replies.

About this Topic