Advertisement
imranmodel32

unlink category function

Mar 2nd, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. // unlink category function
  2. function the_category_unlinked($separator = ' ') {
  3. $categories = (array) get_the_category();
  4.  
  5. $thelist = '';
  6. foreach($categories as $category) { // concate
  7. $thelist .= $separator . $category->category_nicename;
  8. }
  9.  
  10. echo $thelist;
  11. }
  12.  
  13.  
  14.  
  15. function the_texos_unlinked(){
  16. $terms = get_the_terms( $post->ID, 'iso_cat' );
  17.  
  18. if ( $terms && ! is_wp_error( $terms ) ) :
  19.  
  20. $draught_links = array();
  21.  
  22. foreach ( $terms as $term ) {
  23. $draught_links[] = $term->name;
  24. }
  25.  
  26. $on_draught = join( " ", $draught_links );
  27.  
  28. endif;
  29. $on_draught = strtolower($on_draught);
  30. echo $on_draught;
  31. }
  32.  
  33.  
  34.  
  35. // use
  36. <?php the_category_unlinked(' '); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement