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

Conditionally enqueue a widget’s script/stylesheet in HEAD (only when present on page!)

WordPress as a nice function is_active_widget that you can use in your __construct and test if the widget is present in the current page and add your scripts/styles based on that ex: function __construct() { parent::__construct(__CLASS__, ‘BasicWidget’, array( ‘classname’ => __CLASS__, ‘description’ => “This is a basic widget template that outputs text to the sidebar” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)