Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. function extrageCateg($taxonomy, $hide_empty = '1', $title_li = ''){   
  2.    $parametri = array(
  3.         'orderby'            => 'name',
  4.         'order'              => 'ASC',
  5.         'style'              => 'list',
  6.         'hide_empty'         => $hide_empty, // 0 pentru afisare si a categoriilor fara niciun articol, 1 pentru doar afisare categorii cu articole
  7.         'use_desc_for_title' => 1,
  8.         'child_of'           => 0,
  9.         'title_li'           => __($title_li),
  10.         'hierarchical'       => true,
  11.         'number'             => NULL,
  12.         'echo'               => 1,
  13.         'depth'              => 0,
  14.         'current_category'   => 0,
  15.         'pad_counts'         => 0,
  16.         'taxonomy'           => $taxonomy,
  17.         'walker'             => 'Walker_Category'
  18.       );
  19.    
  20.   return wp_list_categories($parametri);
  21. }
  22.    
  23. echo extrageCateg('category', '0', 'Categorii'); // al doilea si al 3lea parametru nu sunt obligatorii
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement