Created
April 19, 2020 08:38
-
-
Save prosantamazumder/46e9793eb28a478a38c5b97803967b25 to your computer and use it in GitHub Desktop.
WordPress Display Custom Post Category in single page.php
This file contains hidden or 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
<div class="sidebar-tags"> | |
<?php | |
$categories = get_the_category( $post->ID ); | |
foreach ( $categories as $category ): | |
?> | |
<a href="<?php echo esc_url( get_category_link( $category->term_id ) ); ?>"><?php echo esc_html( $category->name ); ?></a>'; | |
<?php endforeach; ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment