I've created a custom taxonomy (locations) which is hierarchical, and would like to: a) display an unordered list that respects the hierarchy AND b)customize the display output so that I can specify a custom url
Here's the code I'm using, including the two different ways I'm outputting.
<?php
$args = array(
'taxonomy' => 'locations',
'orderby' => 'name',
'hide_empty' => 0,
'title_li' => '',
'hierarchical' => 1,
'walker' => null,
);
?>
// The following gives me the hierarchical display
<ul class="menu">
<?php wp_list_categories( $args ); ?>
</ul>
// And this gives me the customized links
<?php
$categories = get_categories($args);
foreach($categories as $category) {
echo '<li><a href="http://website.com/?ls=&location=' . $category->slug . '">' . $category->name.'</a></li>';
}
?>
The problem is making BOTH of those things happen.
Any solutions? I'm guessing it might be a custom Walker, but I'm not savvy enough to figure that out without a little guidance!!