Advertisement
aendrew

WP Category Icons -- include/exclude

Jul 9th, 2011
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. add_shortcode('caticons_listing','bm_caticons_listing');
  2. function bm_caticons_listing($atts) {
  3. extract( shortcode_atts( array(
  4. 'include' => '',
  5. 'exclude' =>'',
  6. ), $atts ) );
  7. $listing_code = '';
  8. if ($atts['include']) $include = "&include=".$atts['include'];
  9. if ($atts['exclude']) $include = "&exclude=".$atts['exclude'];
  10. foreach(get_categories("orderby=name&order=ASC&hide_empty=0".$include.$exclude) as $category) {
  11. $listing_code .= $category->cat_name.' '.get_cat_icon("echo=false&cat=".$category->cat_ID);
  12. }
  13. $listing_code .= "";
  14. return $listing_code;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement