Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. /**
  3. * Category Tag
  4. *
  5. * @package Total WordPress Theme
  6. * @subpackage Partials
  7. * @version 3.3.0
  8. */
  9.  
  10. // Exit if accessed directly
  11. if ( ! defined( 'ABSPATH' ) ) {
  12. exit;
  13. }
  14.  
  15. // Only used for outside position
  16. if ( 'outside_link' != $position ) {
  17. return;
  18. }
  19.  
  20. // Get category taxonomy for current post type
  21. $taxonomy = wpex_get_post_type_cat_tax();
  22.  
  23. // Get terms
  24. if ( $taxonomy ) {
  25.  
  26. // Get terms
  27. $terms = wp_get_post_terms( get_the_ID(), $taxonomy );
  28.  
  29. // Display if we have terms
  30. if ( $terms ) {
  31.  
  32. $output = '<div class="overlay-category-tag theme-overlay wpex-clr">';
  33. foreach ( $terms as $term ) {
  34. $output .= $term->name;
  35. }
  36. $output .= '</div>';
  37.  
  38. echo $output;
  39.  
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement