Display custom taxonomy with custom URL
Display custom taxonomy with custom URL
$args=array(
'orderby' => 'name',
'order' => 'ASC',
'taxonomy' => 'topic',
);
$categories=get_categories($args);
$current_url = 'http://'.$_SERVER["HTTP_HOST"] . $_SERVER["REDIRECT_URL"];
foreach($categories as $category) {
echo '<li><a href="'.$current_url.'?taxonomy=topic&term='.$category->slug.'">'.$category->name.'</a></li>';
}

Post a Comment