Retrieve Custom Taxonomy Rewrite Slug
-
I’m looking to retrieve the custom taxonomy slug (or permalink) to use as a way to list all the terms in my custom taxonomy with links to their archive pages. Here is the code i have:
$taxonomyname = get_query_var('taxonomy'); echo '<h3>All ' . $taxonomyname .'</h3><br/>'; $terms = get_terms($taxonomyname); echo "<ul>"; foreach ($terms as $term) { echo "<li><a href='". site_url('/favorite-foods/','') .$term->slug. "'>" .$term->name. "</a></li>"; } echo "</ul>";
the part that says
<a href='". site_url('/favorite-foods/','') .$term->slug. "'>" .$term->name. "</a>
i would like to replace with something like this:
<a href='". site_url() . $my-custom-taxonomy-rewrite-slug . $term->slug . "'>" .$term->name. "</a>
If anyone can point me in the right direction, i would be much obliged!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Retrieve Custom Taxonomy Rewrite Slug’ is closed to new replies.