Guest User

Untitled

a guest
Jun 17th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. function get_the_tags() {
  2.  
  3. $buffy = '';
  4.  
  5. $terms_ui_array = array();
  6. $tags_spot_text = __td('TAGS', TD_THEME_NAME); // the default text for tags - on CPT we can overwrite this via the panel
  7.  
  8. // on single posts we deal with tags
  9. $td_post_tags = get_the_tags($this->post->ID);
  10. if (!empty($td_post_tags)) {
  11. foreach ($td_post_tags as $tag) {
  12. $terms_ui_array[$tag->name] = array (
  13. 'url' => get_tag_link($tag->term_id)
  14. );
  15. }
  16. }
  17.  
  18.  
  19. if (!empty($terms_ui_array)) {
  20. $buffy .= '<ul class="td-mega-menu-tags td-tags td-post-small-box clearfix">';
  21. $buffy .= '<li><span>' . $tags_spot_text . '</span></li>';
  22. foreach ($terms_ui_array as $term_name => $term_params) {
  23. $buffy .= '<li><a href="' . $term_params['url'] . '">' . $term_name . '</a></li>';
  24. }
  25. $buffy .= '</ul>';
  26. }
  27.  
  28. return $buffy;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment