How do I remove UL on wp_nav_menu?

The function wp_nav_menu takes an argument of fallback_cb which is the name of the function to run if the menu doesn’t exist. so change you code to something like this: function wp_nav_menu_no_ul() { $options = array( ‘echo’ => false, ‘container’ => false, ‘theme_location’ => ‘primary’, ‘fallback_cb’=> ‘fall_back_menu’ ); $menu = wp_nav_menu($options); echo preg_replace(array( ‘#^<ul[^>]*>#’, ‘#</ul>$#’ … Read more

How to use wp_nav_menu to create a select menu dropdown?

You can’t do this with wp_nav_menu, because it outputs list items, and you’ll generate invalid markup with your code. Try using wp_get_nav_menu_items() instead. A quick solution for a drop down menu with a custom walker: class Walker_Nav_Menu_Dropdown extends Walker_Nav_Menu{ // don’t output children opening tag (`<ul>`) public function start_lvl(&$output, $depth){} // don’t output children closing … Read more

How to Hard Code Custom menu items

The Problem with your code is that its not actually adding the links to the menu and only to the menu’s output, hence the use of a filter (add_filter) so you are just filtering the output of the menu in fact even if you don’t have a menu your link will be shown with the … Read more

How to add posts to custom menus?

OK, I found the answer to this one and its surprisingly simple but maddeningly frustrating at the same time. All you have to do is click “Screen Options” while viewing the “Custom Menu” manager and place a check beside “Posts” to show the elusive hidden “Posts” widget. Now you can add “Posts” to your custom … Read more

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