Customizing the a tag with Semantic UI

You are definitely on the right track, but wp_nav_menu will output a menu with a lot of containers and classnames; to keep it semantic in the terms of Semantic UI, you’ll be in good hands if you build the structure yourself. Get the name of the registered menu in the menu manager. Check register_nav_menu in … Read more

wp_nav_menu() not working on Custom Search Page

I know this is an old thread but the problem still exists. I think this is a bug. Default queries such as nav should not be affected in making custom search page. Anyways, this is how I fixed it: function fix_nav_menu_in_search($query) { if (is_search()) { $query->set(‘post_type’, [‘your_cpt’, ‘nav_menu_item’]); } return $query; } add_filter(‘pre_get_posts’, ‘fix_nav_menu_in_search’);

Remove/Disable “Automatically add new top-level pages to this menu”

Since there is no filter to remove this option, your best best to to stick to using CSS by putting the following in your child theme’s functions.php: add_action( ‘admin_head’, ‘wpse_225635_menu_css’ ); function wpse_225635_menu_css() { global $pagenow; if ( $pagenow == ‘nav-menus.php’ ) { ?> <style type=”text/css”> .auto-add-pages { display: none; } </style> <?php } }

Getting URL value from menu item by ID

Guessing the only way you get it without loop through the menu, is getting the post meta directly. Navigation menus are saved as custom post type into wp_posts, so you can get it with get_posts or get_post_meta. If it’s a custom link menu item, the code below should do it. Where $menu_id is you menu … Read more

Remove ‘Menus’ from Twenty Sixteen theme Customizer

Thanks Dharmishtha, but I found the answer in below stack which worked really well without throwing any debug errors: How to remove menus section from WordPress theme customizer The correct way to disable ‘Menus’ and ‘Widgets’ (in Customizer) lies in creating a plugin with below code (taken from the above mentioned post to make it … Read more

HTML Bootstrap navigation menu to WordPress menu using wp_nav_menu

You have to edit the files in: wordpress/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php and then create a custom walker, try to take a look here. Try in this way: <?php /** * Displays top navigation * * @package WordPress * @subpackage Twenty_Seventeen * @since 1.0 * @version 1.2 */ ?> <div class=”container”> <nav class=”navbar navbar-expand-lg navbar-light” id=”mainNav”> <a class=”navbar-brand js-scroll-trigger” … Read more