Incorrect Behavior on WordPress Main Menu

I think you forgot to set the menu location. Below the menu (depending on the used theme) – right below that what your image shows are one or more checkboxes “Location in the theme”. Select the “primary” menu If no menu location is selected, the fallback is to show every page in hierarchical order from … Read more

Custom post type category link + add to menu

try this, I believe this should allow you to have category taxonomy in menu and available in your custom post type. function custom_post_type() { $labels = array( ‘name’ => _x( ‘Post Types’, ‘Post Type General Name’, ‘text_domain’ ), ‘singular_name’ => _x( ‘hotel’, ‘Post Type Singular Name’, ‘text_domain’ ), ‘menu_name’ => __( ‘Post Types’, ‘text_domain’ ), … Read more

How to create a sub-page of sub-page?

I may be completely misunderstanding your question but I think you’re trying to create something like the image below. Correct? If that’s the case you would create the menu structure either using the “Customize” or the “Menu” option in the “Appearance” menu in WordPress. The you simply arrange menu items the way you want them … Read more

How to disable users to view Other pages

<?php add_filter(‘pre_get_posts’, ‘my_current_author_posts’); function my_current_author_posts( $query ) { global $pagenow; // Check if you are on the right Admin page, do nothing if not if( ‘edit.php’ != $pagenow || ! isset( $_GET[‘post_type’] ) || ‘page’ != $_GET[‘post_type’] || ! is_admin() ) { return; } // get current user Object $current_user = wp_get_current_user(); // check user … Read more

How to remove a sub-menu using walker hooks/filters without relying on a custom walker?

best and easy way to hide submenu is to use css .sub-menu { display: none !important; } Or you can use ‘depth’=>1 `wp_nav_menu( array( ‘menu_id’=>’nav’, ‘theme_location’=>’header-menu’ , ‘depth’ => 1) ); or create a function to set the ‘depth’=>1 for a perticular menu. place this code in your theme function.php add_filter( ‘wp_nav_menu_args’, ‘remove_my_header_dropdown’, 1, 1 … Read more