Advertisement
fauzanjeg

Show Custom Taxonomy in Post Meta

Jun 22nd, 2021 (edited)
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php
  2. /** Show Custom Taxonomy in Post Meta */
  3. function show_custom_taxonomy() {
  4.     $term_list = wp_get_post_terms( get_the_ID(), 'ubicaciones' );
  5.     // var_dump($term_list); /* Check Term List */
  6.     // var_dump(get_taxonomies()); /* Check Taxonomy List */
  7.     if ( ! empty( $term_list ) ) {
  8.         echo '<a href="' . get_term_link( $term_list[0] ) . '">' . $term_list[0]->name . '</a>';
  9.     }
  10. }
  11. add_action( 'jnews_render_after_meta_left', 'show_custom_taxonomy' );
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement