Third level navigation class

You don’t need to write your custom Walker for that… Let’s take a look on built-in Walker_Nav_Menu. You’ll find this function: public function start_lvl( &$output, $depth = 0, $args = array() ) { if ( isset( $args->item_spacing ) && ‘discard’ === $args->item_spacing ) { $t=””; $n = ”; } else { $t = “\t”; $n … Read more

Custom Post Type Navigation on Custom Field

For previous and next post links to work, you need to hook on to the get_*_post_* filters and modify the query to actually sort the posts using your custom field. I hope the code below will work for you. For Previous post link add_filter(‘get_previous_post_join’, ‘wpse96670_get_previous_post_join_custom_sort’); add_filter(‘get_previous_post_where’, ‘wpse96670_get_previous_post_where_custom_sort’); add_filter(‘get_previous_post_sort’, ‘wpse96670_get_previous_post_sort_custom_sort’); function wpse96670_get_previous_post_join_custom_sort($join) { global $wpdb; return … Read more

Menu fallback “menu_class” rendering a “div” instead of a “ul”

First, I think you’re confusing the wp_nav_menu() args. The ‘menu_class’ parameter defines the class added to the menu element, which by default is <ul>, as per the ‘items_wrap’ parameter. The default ‘menu_class’ is ‘menu’, which results in <ul class=”menu”>. The real issue is actually the fallback_cb – the callback used when no menu is defined … Read more

wp_nav_menu not highlighting the current category when viewing a single post

There are several built-in CSS classes that come with the wp_nav_menu. In your case, you are looking for something like a current category class, which is not included. But we can easily add that to the CSS classes: function wpse_134409_current_category_class($classes, $item) { if ( is_single() && ‘category’ === $item->object && in_array($item->object_id, wp_get_post_categories($GLOBALS[‘post’]->ID)) ) $classes[] = … Read more

Use wp_nav_menu to display ALL pages

You could move away from wp_nav_menu() completely and instead use wp_list_pages(). See the codex for more information, but I believe this may be what you are looking for. http://codex.wordpress.org/Function_Reference/wp_list_pages I do understand that this function outputs the pages. The point I was trying to make though is that you can use this in conjunction with … Read more

wp_nav_menu add some element to container

This is fairly straightforward, assuming you have access to the php files. In the template that generates the menu, modify the wp_nav_menu call to specify container = FALSE, and to provide the container and additional div manually in the surrounding HTML. Without knowing your code in advance, one method would be to alter it as … Read more

Adding Custom “Current Menu Item” class to navigation?

You declared the same function name, that’s the cause of the “declared error”. Just change the class function (including in the filter hook). Or you can just extend your function code. I also would rewrite the if structure to have a more easy readibility: add_filter( ‘nav_menu_css_class’, ‘add_custom_class’, 10, 2 ); function add_custom_class( $classes = array(), … Read more

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