Advertisement
bennyp

Untitled

Apr 9th, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. function horizontal_category_func( $parent, $content = null ) {
  2.  
  3.     extract(shortcode_atts(array(
  4.         "parent" => 'ID'
  5.     ), $parent));
  6.    
  7.     $slug = $parent->slug;
  8.     $cat_name = get_the_category_by_ID( $parent );
  9.     $cat_title = "<h3><a href=\"category/$slug\">$cat_name</a></h3>";
  10.     $cat_list = wp_list_categories( "child_of=$parent&show_count=0&title_li=&echo=0" );
  11.  
  12.     return $cat_list;
  13. }
  14.  
  15. add_shortcode( 'horizontal_category', 'horizontal_category_func' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement