Reorder custom submenu item

Got it, thanks to cjbj‘s help, I was able to get the final solution: add_filter( ‘custom_menu_order’, ‘submenu_order’ ); function submenu_order( $menu_order ) { # Get submenu key location based on slug global $submenu; $settings = $submenu[‘options-general.php’]; foreach ( $settings as $key => $details ) { if ( $details[2] == ‘blogging’ ) { $index = $key; … Read more

How show sub menu only using wp_nav_menu()

I’ve made a free plugin which solves this problem! https://wordpress.org/plugins/wp-nav-menu-extended/ This plugin extends the native wp_nav_menu function and adds additional options: level : (integer) (required for this plugin to work) The level of the navigation menu to show. If no child_of parameter is passed, it shows all the items of this level child_of : (string|integer) … Read more

Multi Level Bootstrap Navigation Menu in WordPress

Here some thing interesting for you STEP 1 add a script to header like below ( it’s always better go for the enqueue method . i need some one to help me with properly adding the below script in WordPress way .jquery should run before the second script> <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js” type=”text/javascript”></script> <script> $(document).ready(function () { … Read more

Get page by template?

The page template’s filename is stored as a post meta with key ‘_wp_page_template’, so basically you can use get_post_meta($post_id, ‘_wp_page_template’, true); to get the template filename for the page with ID $post_id. You can also do the reverse (i.e. getting id from page template filename) using Custom Field Parameters in WP_Query or other wordpress functions. … Read more

How Can I remove or hide the export page in WordPress menu?

Whenever in doubt about a WordPress function, consult the Codex: Function_Reference/remove_menu_page. The correct function is remove_submenu_page hooked into admin_menu. add_action( ‘admin_menu’, ‘remove_submenu_wpse_82873’ ); function remove_submenu_wpse_82873() { global $current_user; get_currentuserinfo(); // If user not Super Admin remove export page if ( !is_super_admin() ) { remove_submenu_page( ‘tools.php’, ‘export.php’ ); } } And then you’d probably would like … Read more