Guest User

Untitled

a guest
Dec 20th, 2010
76
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // Return tag link
  3. // Argument: 'css' or array( 'css' ) or array( 'css', 'design' )
  4. function ozh_get_tag_link( $tags = array() ) {
  5.     if( !$tags )
  6.         return get_home_url();
  7.    
  8.     global $wp_rewrite;
  9.     $tags = implode( (array)$tags, '+' );
  10.    
  11.     if( $perm = $wp_rewrite->get_extra_permastruct('post_tag') ) {
  12.         // we have pretty permalinks
  13.         return trailingslashit( get_home_url() ) . str_replace( '%post_tag%', $tags, $perm );
  14.     } else {
  15.         // default links eg http://bleh.com/?tag=bleh
  16.         return trailingslashit( get_home_url() ) . '?tag=' . $tags;
  17.     }
  18. }
RAW Paste Data