Title: a function
Last modified: August 19, 2016

---

# a function

 *  [runeveryday](https://wordpress.org/support/users/runeveryday/)
 * (@runeveryday)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/a-function/)
 *     ```
       function itx_menu_($args){
       	$cat_inc=$page_inc=0;
       	$menu_class='';
           extract(itx_get_option('menu'));
           extract(wp_parse_args($args));
           if($theme_location=='top'){
               $home=$top_home;
               $depth=$top_depth;
               $show=$top_show;
           }
           if ($show){
               echo '<ul class="'.$menu_class.'">';
               if ($home) echo '<li><a href="'.get_option('home').'">'.$home.'</a></li>';
   
               if ($cat_inc){
                 @sort($cat_inc);
                 $cat_inc=@implode(',',$cat_inc);
                 $opt="&include=$cat_inc";
                 if ($cat_sortby) {$opt.="&orderby=".$cat_sortby;};
                 if ($cat_order) {$opt.="&order=".$cat_order;};
                 $cat_args="title_li=&depth=$depth$opt";
               } else {
                 $cat_args='title_li=&number=15';
               }
   
               if ($page_inc){
                 @sort($page_inc);
                 $page_inc=@implode(',',$page_inc);
                 $opt="&include=$page_inc";
                 if ($cat_sortby) {$opt.="&orderby=".$cat_sortby;};
                 if ($cat_order) {$opt.="&order=".$cat_order;};
                 $page_args="title_li=&depth=$depth$opt";
               } else {
                 $page_args='title_li=&number=9';
               }
   
               if ($show=='cat'){
                   wp_list_categories($cat_args);
   
               } elseif ($show=='page'){
                   wp_list_pages($page_args);
               } elseif ($show=='cp'){
                   wp_list_categories($cat_args);
                   wp_list_pages($page_args);
               } elseif ($show=='pc'){
                   wp_list_pages($page_args);
                   wp_list_categories($cat_args);
               }
               echo'</ul>';
   
           }
       }
       ```
   
 * can’t understand this function well, expect someone can explain it for me. thank
   you.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/a-function/#post-1812757)
 * what part of it are you trying to figure out?
 * Generically, looks like it displays your menu. I’m guessing the theme has an 
   admin options page. The code displays the menu based on the variety of options
   that seem available through the admin menu
 *  Thread Starter [runeveryday](https://wordpress.org/support/users/runeveryday/)
 * (@runeveryday)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/a-function/#post-1812966)
 * Rev. Voodoo,you’re right. the theme has an admin options page.
 * extract(itx_get_option(‘menu’)); //don’t know this
 *  extract(wp_parse_args($args)); //don’t know this
 * if ($cat_inc){
 *  [@sort](https://wordpress.org/support/users/sort/)($cat_inc); //don’t know this
 *  $cat_inc=@implode(‘,’,$cat_inc);
 *  $opt=”&include=$cat_inc”; //don’t know this
 *  if ($cat_sortby) {
 * $opt.=”&orderby=”.$cat_sortby;}; //don’t know this
 *  if ($cat_order) {
 * $opt.=”&order=”.$cat_order;}; //don’t know this
 *  $cat_args=”title_li=&depth=$depth$opt”; //don’t know this
    } else { $cat_args
   =’title_li=&number=15′; //don’t know this
 * i have refered the php documentation, but still down’t know these lines.expect
   you can give me an explaintation to me. thank you,

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘a function’ is closed to new replies.

## Tags

 * [function](https://wordpress.org/support/topic-tag/function/)

 * 2 replies
 * 2 participants
 * Last reply from: [runeveryday](https://wordpress.org/support/users/runeveryday/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/a-function/#post-1812966)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
