Guest User

Untitled

a guest
Jul 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. function category_list_menu(){
  2. $cat_ids = get_all_category_ids();
  3. foreach($cat_ids as $ID){
  4. if($ID != 35){
  5. if(in_category($ID)){
  6. $IDs .= 'cat-item-'.$ID.' ';
  7. }
  8. $cats .= strtolower(get_cat_name($ID)).' ';
  9. }
  10. }
  11. $cleaned = str_replace("type ", "", $cats);
  12. $active = substr($IDs,0,-1);
  13. $cat_class = substr($cleaned,0,-1);
  14.  
  15. if(is_single() && !is_page()){
  16. echo '<ul id="cat-menu-single" class="'.$active.'">';
  17. wp_list_categories('hide_empty=0&title_li=&exclude=35');
  18. echo '</ul>';
  19. }
  20. elseif(is_page('random') || is_page('top-rated')){
  21. echo '<ul id="cat-menu-page" class="'.$cat_class.'">';
  22. wp_list_categories('hide_empty=0&title_li=&exclude=35');
  23. echo '</ul>';
  24. }
  25. else{
  26. echo '<ul id="cat-menu" class="'.$cat_class.'">';
  27. wp_list_categories('hide_empty=0&title_li=&exclude=35');
  28. echo '</ul>';
  29. }
  30. }
Add Comment
Please, Sign In to add comment