How to remove dropdown from wp_nav_menu

We can use depth parameter of wp_nav_menu to set how many levels menu walker traverses. wp_nav_menu( array( ‘menu_id’=>’nav’, ‘theme_location’=>’header-menu’ , ‘depth’ => 1) ); You can create a child theme so that updates won’t override during updates. Create child theme and copy code from header.php of parent theme then replace the code wp_nav_menu( array( ‘menu_id’=>’nav’, … Read more

wp_dropdown_pages auto submit

You can use the following piece of code. <form action=”<?php bloginfo(‘url’); ?>” method=”get”> <?php $select = wp_dropdown_pages( array( ‘post_type’ => ‘ce_artists’, ‘show_option_none’ => ‘Select Artist’, ‘echo’ => 0 ) ); echo str_replace(‘<select ‘, ‘<select onchange=”this.form.submit()” ‘, $select); ?> </form> You can find a similar example here in the codex

Dropdown filtering extremely slow

I’m surprised it’s all that slow but you can remove all but one of the database calls & most of the looping by passing the term data instead of just slugs to my_dropdown_categories() so get_terms() doesn’t have to be called, plus a few other improvements (see comments) eg: function my_dropdown_categories( $taxonomy, $current_selected = ”, $terms … Read more

How to add html attributes to the “ul” html tag with “wp_nav_menu” function?

wp_nav_menu has all the documentation written there. You just need to put “ul” in the parameter “container”. So your modified function call will be, wp_nav_menu( array( ‘theme_location’ => ‘main-menu’, ‘container => ‘ul’, ‘container_id’ => ”, // put id of ul if needed ‘menu_class’ => ” // as needed ) ); For custom attributes you need … Read more

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