Last active
August 29, 2015 14:04
-
-
Save atsea/d361ff73e8f03e5d90b8 to your computer and use it in GitHub Desktop.
WordPress: Get the Current Taxonomy of the Post
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
require_once('functions.php'); | |
if ( is_active_sidebar( 'sidebar-1' ) ){ | |
$terms = get_the_terms( $post->ID, 'software_categories' ); | |
foreach ( $terms as $term ) { | |
$term_link = get_term_link( $term, 'software_categories' ); | |
echo "<a href='".$term_link."'>" . $term->name . "</a>, "; | |
} | |
?> | |
<div id="sidebar"> | |
<h3>Category</h3> | |
<ul> | |
<li><a href="/software-by-category/Antivirus and Security/"><?php echo $category->name; ?></a></li> | |
</ul> | |
<?php dynamic_sidebar( 'sidebar-1' ); ?> | |
</div> <!-- end #sidebar --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment