Enter your keyword

Blog

How to get terms in Wordpress

function get_year_taxonomy_child() {
    $values = get_terms('events-years');
    foreach ($values as $value) {
    $categories[] = array('name'=>$value->name,'slug'=>$value->slug);
    }
  $output = '';
    $output .= '<div id="dd11" class="wrapper-dropdown-11 dropdown_list" tabindex="4">
  <span>'.__('All Years','vh').'</span>
  <ul class="dropdown">';
    foreach ( $categories as $cat ) {
    $output .= '<li><a href="#">'.$cat['name'].'</a><input type="hidden" value="'.$cat['slug'].'"></li>';
    }
  $output .= '</ul>
  </div>';
return $output;
    }

No Comments

Add your review

Your email address will not be published.

* Feilds are Required.