0,
'sort_order' => 'ASC',
'sort_column' => 'post_title',
'hierarchical' => 1,
'exclude' => '',
'include' => '',
'meta_key' => '',
'meta_value' => '',
'authors' => '',
'parent' => -1,
'exclude_tree' => '',
'number' => '',
'offset' => 0 );
//GET all pages
$pages_array = get_pages($pages_args);
$items_counter = $counter;
$parentli = $items_counter;
if ( !$pages_array ) {
echo __('Not Found');
return $items_counter;
}
// Display Loop
foreach ( $pages_array as $post ) {
if ( $post->post_parent == 0 ) {
$post = wp_setup_nav_menu_item($post, 'page', $items_counter);
if ( $type == 'menu' ) {
?>
ID;
$items_counter++;
$items_counter = wp_nav_menu_sub_items($post->ID, $items_counter, $parentli, 'pages', 'default');
?>
'post',
'child_of' => 0,
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => false,
'include_last_update_time' => false,
'hierarchical' => 1,
'exclude' => '',
'include' => '',
'number' => '',
'pad_counts' => false );
$items_counter = $counter;
// Get all categories
$categories_array = get_categories($category_args);
if ( !$categories_array ) {
_e('Not Found');
return $items_counter;
}
// Display Loop
foreach ( $categories_array as $cat_item ) {
if ( $cat_item->parent == 0 ) {
$cat_item = wp_setup_nav_menu_item($cat_item, 'category', $items_counter);
// Custom Menu
if ( $type == 'menu' ) {
?>
cat_ID;
$items_counter++;
$items_counter = wp_nav_menu_sub_items($cat_item->cat_ID, $items_counter, $parentli, 'categories', 'default');
?>
$childof,
'hide_empty' => false,
'parent' => $childof);
} elseif ( $output_type == 'default' ) {
// Sidebar Menu
$sub_args = array(
'child_of' => $childof,
'hide_empty' => false,
'parent' => $childof);
}
if ( $type == 'categories' ) {
// Get Sub Category Items
$item_type = 'category';
$sub_array = get_categories($sub_args);
} elseif ($type == 'pages') {
// Get Sub Page Items
$item_type = 'page';
$sub_array = get_pages($sub_args);
} else {
$item_type = 'custom';
$sub_array = array();
}
if ( $sub_array ) {
?>
-
ID, $counter, $sub_item->ID, $type, 'default');
?>
term_id );
}
}
wp_create_nav_menu( __('Main') );
}
/**/
?>