Wp_nav_menu ( array ( 'container_class' => 'main-nav', 'theme_location' => 'primary' ) ) In your theme, open up the header.php file. Instead, WordPress uses a PHP function to query the database and fetch navigation menu items, then display them in the correct structure.Įach item in your navigation menu is actually a post in the wp_posts table in your database-not a normal post, but a special kind of post that's used just for navigation menu items, with its own metadata including the text to be displayed and the target of the link. Unlike with static sites, menus aren't hard-coded into your site. The first thing you'll need to understand is how WordPress drop-down menus work. a theme you're coding yourself, or a child theme of a third-party theme if you want to modify the menuġ.a development installation of WordPress.To follow along with this tutorial, you'll need: What You'll Need to Create a Drop-Down Navigation Menu in HTML on WordPress Make your drop-down menu design mobile-friendly.Get familiar with code so you can learn how to make a drop-down menu in HTML.Understand how WordPress drop-down menus work through the built-in menu functionality.Here's What You'll Learn in This Drop-Down Menu Design Tutorial However, if you're working with a third-party theme whose menu isn't drop-down and you want to add this, then you'll need to create a child theme and add your menu code to that. This is designed to be used in a theme you're coding yourself, and not for a third-party theme, which will already have its own menu. In this tutorial, I'm going to show you how to create a drop-down menu in your WordPress theme, using CSS to target the HTML that's output by the WordPress menu function. How to Make a Drop-Down Menu in WordPress If you'd rather watch our video on creating a drop-down menu in HTML for WordPress, just press play and get started. This will come in useful on more sites than you might imagine (not every site needs a fancy menu), and it will give you the foundation you need to start building more advanced menus. From burger menus for mobile through mega menus for stores to sticky menus for enhanced user experience, there's a great choice in the way you can present your navigation menu on your WordPress site.īut what if you want to create a straightforward drop-down menu for WordPress with a few top-level items and some more items that drop down from them when the user hovers over them?īefore you start getting into coding advanced menus like mega menus and burger menus, it's a good idea to learn how to create a drop-down menu. Navigation menus are having a bit of a moment in the spotlight. Do you want to create a drop-down menu in WordPress? You've come to the right place! In this tutorial, I'll teach you how to create a professional drop-down menu design.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |