Walker or wp_get_nav_menu_items VS jQuery

As you know, walker is server side method while jQuery is client side method. You need to choose what will be the best in any situation. If you don’t use a dedicated Walker for each menu, default WordPress Walker will run so why don’t use your own and adapt it via jQuery for the different … Read more

wp_nav_menu doesn’t seem to work on custom post type pages

You can just add these parameters in array variable and pass this to wp_nav_menu() Like: function get_menu_params(){ $defaults = array( ‘menu’ => ‘Primary Menu’, ‘theme_location’ => ‘primary’, ‘depth’ => 3, ‘container’ => ‘div’, ‘container_class’ => ‘a’, ‘container_id’ => ‘b’, ‘menu_class’ => ‘nav navbar-nav’, ‘fallback_cb’ => ‘wp_bootstrap_navwalker::fallback’, ‘walker’ => new wp_bootstrap_navwalker() ); return $defaults; } and … Read more

PHP drop down menu for my get_category child of

You can use the function wp_dropdown_categories() instead of wp_list_categories(), if you dont need to use the list function. wp_dropdown_categories() seems to be working just like the list function. So first just try and replace these two functions. $terms = wp_dropdown_categories( array( … Read about it in the codex here.

User WordPress menu in custom page

You’ll need to load in the external wordpress library first, and then you can call the admin bar. // Load the external WordPress files define( ‘WP_USE_THEMES’, false ); require( ‘./wp-load.php’ ); and then call wp_head() and wp_footer() accordingly to load the relevant display code.