How to add sub-menu to a menu generated by wp_nav_menu by using plugin

You can modify your menu by using walker. include(‘subMenu.php’); $menu = wp_nav_menu( array(‘menu’ => ‘YOUR-MENU-NAME’,’menu_class’ => ‘megamenu’,’walker’ => new subMenu)); create a file subMenu.php in theme folder add below code. <?php class subMenu extends Walker_Nav_Menu { function end_el(&$output, $item, $depth=0, $args=array()) { if( ‘Item 3’ == $item->title ){ $output .= ‘<ul class=”sub-menu”> <li class=”menu-item” id=”menu-item-48″><a … Read more

Add screen options to custom admin pages

You don’t need to invent a new screen option row. Just use proper metaboxes. Currently, you are drawing pseudo-metaboxes: <!– Post status start–> <div class = “postbox”> <div class = “handlediv”> <br> </div> <h3 class = “hndle”><span><?php _e(“By Post Status”, ‘bulk-delete’); ?></span></h3> <div class = “inside”> <h4><?php _e(“Select the posts which you want to delete”, … Read more

Correct way to enqueue jquery-ui

First of all, WordPress registers jQuery UI via wp_default_scripts(). Dependencies are already set, so you only need to enqueue the script you really need (and not the core). Since you’re not changing version number or anything, it is ok to only use the handle. // no need to enqueue -core, because dependancies are set wp_enqueue_script( … Read more