Exclude one item from wp_list_pages( $args );

There’s a filter called wp_list_pages_exclude that you could possibly hook into (put this in your functions.php): function filter_wp_list_pages($exclude){ $exclude[] = 56; return $exclude; } add_filter(“wp_list_pages_excludes”, “filter_wp_list_pages”);

wordpress nav menu using twitter bootstrap

For a copy paste solution check this custom Walker out: http://goodandorgreat.wordpress.com/2012/01/12/update-2-using-twitter-bootstrap-dropdown-menus-with-wordpress/ It’s missing one or two things like data-toggle=”dropdown” and <b class=”caret”></b>. It should be quite easy to figure that out, but here’s my modified version: https://gist.github.com/1817371 Hope that helps.

How do I fix this error: Warning: invalid argument supplied for foreach()?

This usually happens when you are trying to do admin navigation stuff and you aren’t hooked into admin_menu. If you hook in before that, $menu hasn’t been created yet. add_action(‘admin_menu’, ‘my_plugin_add_menu’); function my_plugin_add_menu(){ $ptype=”my_post_type”; $ptype_obj = get_post_type_object( $ptype ); add_submenu_page( ‘my-menu-item’, $ptype_obj->labels->name, $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, “edit.php?post_type=$ptype” ); }

Custom Nav Walker menu – Display children count

I sort of added onto @Giri’s answer by using array_map and array_count_values. if this helps anyone in the future. I didn’t wish to use a counter and a foreach loop for something so simple. function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { if ($item->hasChildren) { $locations = get_nav_menu_locations(); … Read more

Hide custom post type from nav menu manager

// set up the arguements for post type $labels = array(….); $args = array( ‘labels’ => $labels, ‘public’ => true, // display on menu and site ‘publicly_queryable’ => false, ‘show_ui’ => true, ‘query_var’ => false, ‘rewrite’ => false, ‘capability_type’ => ‘post’, ‘hierarchical’ => false, ‘menu_position’ => 111, ‘supports’ => array( ‘title’ ) ); // register … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)