Category menu that filters out empty categories

I had an error in the above code. $key used in both for loops. Working code for filtering empty product categories out of menu items: function exclude_empty_cat_menu_items( $items, $menu, $args ) { // Get a list of product categories that excludes empty categories $non_empty_categories = get_categories(array(‘taxonomy’ => ‘product_cat’)); // Iterate over the menu items foreach … Read more

Horizontal Navigation

You could use conditional statements to show the children. Depending on what your using to categorize the pages… If you were using parent / children categories it would work something like this: <?php if ( in_category( ‘New Watches’ )) { // show new watches menu } elseif ( in_category( array( ‘Classic Watches’ ) )) { … Read more

Making a Custom Menu Sidebar Icon show as Current in css [closed]

This isn’t really WordPress specific, but here goes. Really, all you’re missing is applying the blue background image on .current-menu-item a. /* Default state base */ .widget_nav_menu .menu li a{ padding-left: 35px !important; background-position: 5% 50%; background-repeat: no-repeat; } /* Active state base */ .widget_nav_menu .menu .current-menu-item a, .widget_nav_menu .menu .current-menu-item a, .widget_nav_menu .menu .current-menu-parent … Read more

Display a tag before the menu list content

Put this function into your theme’s function.php file. function is_tree($pid) { // $pid = The ID of the page we’re looking for pages underneath global $post; $anc = get_post_ancestors( $post->ID ); foreach($anc as $ancestor) { if(is_page() && $ancestor == $pid) { return true; } } if(is_page()&&(is_page($pid))) { return true; /*we’re at the page or at … Read more

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