Making a Customized Navigation Menu in WordPress

광고

With the ability to add and take away hyperlinks from a web website’s essential navigation menu is a primary characteristic present in most website CMS’s. As of WordPress 3.0, there’s built-in assist for including a navigation menu to any theme. Moreover, these navigation menus may be created and configured simply within the WordPress admin panel. WordPress customized menus should nevertheless be enabled on your present theme earlier than it is possible for you to to full use them 태블릿메뉴판.

Including Assist for Navigation Menus

You’ll have to add the PHP code offered under to your theme’s features.php file (in any other case the customized menu possibility won’t present up within the admin panel):

add_theme_support( ‘menus’ );

Including a Navigation Menu to a WordPress Theme

Subsequent it would be best to inform WordPress the place in your theme you need to place a menu. Typically, you’ll need to do that someplace in your header.php file, the place your theme’s header content material is positioned. Chances are you’ll nevertheless add a customized menu to any a part of your WordPress theme you assume is finest. Utilizing the code offered under you possibly can simply create one and even a number of spots for a customized menu to seem:

‘Prime Menu’, ‘sort_column’ => ‘menu_order’, ‘container_class’ => ‘top-menu’ ) );?>

The above code is an easy name to the wp_nav_menu operate which is constructed into the WordPress engine. The argument offered incorporates an array of attributes that could be used to configure the best way a customized menu must be displayed at this location within the theme.

 

  • The primary attribute is name, which is the name or label that may determine this menu in WordPress.
  • The second attribute is sort_column, which we gave a price of menu_order. This feature tells WordPress that we need to use the ordering we select within the admin panel.
  • The third attribute is container_class. This controls which CSS class shall be used to model the menu.

 

Benefits of Utilizing WordPress Navigation Menus

As you possibly can already in all probability see, there are lots of benefits to utilizing the customized menu characteristic that’s now offered in WordPress 3.0. Most website homeowners start by including a easy navigation menu to the highest of their WordPress theme, nevertheless you possibly can actually add many extra customized menus then only one. One other benefit, is the flexibility so as to add a customized menu as a widget to your sidebar. Once more this characteristic can also be built-in to the WordPress admin panel.