How to make a drop down menu with categories

You have to modify only the first part as this: <ul id=”nav” class=”clearfloat”> <li class=”cat-item”><a href=”https://wordpress.stackexchange.com/questions/108006/<?php echo get_option(“home’); ?>/” class=”on”><?php echo get_option(‘blogname’); ?></a> <ul class=”children”> <?php wp_list_categories(‘orderby=name&title_li=’); $this_category = get_category($cat); if (get_category_children($this_category->cat_ID) != “”) { echo “<ul>”; wp_list_categories(‘orderby=id&show_count=0&title_li= &use_desc_for_title=1&child_of=”.$this_category->cat_ID); echo “</ul>”; } ?> </ul> </li> <?php wp_list_pages(“title_li=’); ?> </ul> Here the menu will show up … Read more

WP NAV MENU – Dropdown always showing

You have to modify style.css. What you should do is look at your source code and see the structure you generated for your menu, and then change your menu accordingly. There are lots of tutorials on the web, all you have to do is Google “css menu tutorial” or “css menu example” and you will … Read more

Problem with custom menus

You have created menu “placeholders” of sorts but you haven’t added any actual menus yet, thus you see a kind of default menu being displayed. Go to wp-admin -> Appearance -> Menus Create a menu Assign the menu to one of your menu locations Add something to the menu Save Now you should see the … Read more

Get first menu item of custom menu

Ok, real stupid while writing this post I was thinking about first looping of the menu items and then storing them in an array for later use. With the example on the following page I can manage that: http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items // Get the nav menu based on $menu_name (same as ‘theme_location’ or ‘menu’ arg to wp_nav_menu) … Read more

Create custom page and custom menu

If I understand you, what you are doing is almost correct. You need add_menu_page instead of add_submenu_page add_action(‘admin_menu’, ‘register_my_custom_submenu_page’); function register_my_custom_submenu_page() { add_menu_page( ‘My Custom Submenu Page’, ‘My Custom Submenu Page’, ‘manage_options’, ‘my-custom-submenu-page’, ‘my_custom_submenu_page_callback’ ); } function my_custom_submenu_page_callback() { echo ‘<h3>My Custom Submenu Page</h3>’; } As far as the “embedded” PHP, you already have it. … Read more

How to avoid website url appending problem in wp site?

Turn off all plugins and switch to Twenty Thirteen to see if the problem goes away. If yes: figure out which theme and or plugin is causing the problem and re-post a more specific question. If no: re-install WP and follow set-up procedure. Back up data first if working live.