Last active
July 24, 2024 18:04
-
-
Save JiveDig/7646559 to your computer and use it in GitHub Desktop.
Show list of terms from a custom taxonomy linked to their archive pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'genesis_before_loop', 'spears_do_resource_term_links' ); | |
function spears_do_resource_term_links() { | |
// Show Custom Taxonomy | |
$args = array( 'taxonomy' => 'resource_type' ); | |
$terms = get_terms('resource_type', $args); | |
echo '<div class="resource-types">'; | |
echo '<ul>Sort by Type: '; | |
foreach ($terms as $term) { | |
echo '<li><span class="comma">, </span><a href="' . get_term_link( $term ) . '" title="' . $term->name . '">' . $term->name . '</a></li>'; | |
} | |
echo '</ul>'; | |
echo '</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment