BloggingTips.Guru

Learn How to Blog Effectively

  • Facebook
  • Linkedin
  • Pinterest
  • RSS
  • Twitter
  • Home
  • Blog
    • Blogging
    • SEO
    • Web Hosting
    • WordPress
  • Earn Money
  • About
  • Contact
  • Start a Blog
  • Deals for Bloggers
BloggingTips.Guru WordPress How to Use WordPress Advanced Menu Options

How to Use WordPress Advanced Menu Options

Author: Rajesh Namase   Last updated on: May 4, 2020    Leave a Comment  

In the WordPress 3.0 version called the “Menu Update”, there were some nifty things added to the menu options but only a few of us uses them. The reason for this is, because they need to be activated. These options are not shown as default we need to activate. But if we make use of these options we can do a lot of cool stuff to make our blogs, websites more unique.

WordPress Advanced Menu Options

How to Activate the WordPress Advanced Menu Options

To activate these options, go to your WordPress dashboard then Appearance -> Menus. When you are at the menu options look for a button called, screen options, it should be at the top right of your screen. When you click it the following should appear.

Screen Options WordPress Menus

Then you can activate the ones you would like to. After you activated them, when you add a new menu item or you modify one, the options for you should look like the following:

WordPress Menu Options Screenshot

Link Target

The first option is the “Link target” this is pretty self explanatory. Using this option you can change how the links in the menu open. If you tic the check box the if you click on the menu link, it will open in a new tab in your browser.

CSS Classes

Using this option you can add custom CSS classes to each of your menu links. And with that you can stylize each menu link separately. If you know a bit of CSS the possibilities are endless. For example: name our menu item dev and we add the following Style to it:

 

.dev {
background:#efefef;
}

We should get something like this:

WordPress Menu Custom CSS

Link Relationship

Link Relationship is used to make relationships between links and websites easier. You can define it as “friend”, “nofollow” or what ever you’d like to. This option is the most useful when we are talking about backlinks. Using this method search engines can understand the relationship between the websites linked to each other via backlinks.

Description

You can add descriptions to any of your menu links using this options. Through not many themes support this. But you can add this option so your theme will display the description of each menu link if it is set by created a walker script then implementing it into your menu registration.

The walker script

Open your theme’s functions.php and add the following code at the bottom:

class My_Walker extends Walker_Nav_Menu
{
function start_el($output, $item, $depth, $args) {
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';

$class_names = $value = '';

$classes = empty( $item->classes ) ? array() : (array) $item->classes;

$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
$class_names = '';

$output .= $indent . '

ID . '"' . $value . $class_names .'>';
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';

$item_output = $args->before;
$item_output .= '<a '. $attributes .'>';
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$item_output .= '' . $item->description . '';
$item_output .= '';
$item_output .= $args->after;

$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
}
}
?>

Then add your new walker script to your menu. This is NOT in your functions.php, you can find the code below where you menu is displayed.

< ?php $walker = new My_Walker; wp_nav_menu(array( 'theme_location' => 'primary-menu',
'walker' => $walker
));
?>

Conclusion

As WordPress updates, they add a lot of cool new features for us to use. So why not play attention to them? Many people didn’t know about these options because they are hidden and require ONE click to be shown. The options listed above can make a huge difference in your blog.

Share
Tweet
Pin
Share
0 Shares

Filed Under: WordPress    Tagged: WordPress Tips, WordPress Tutorials

Share
Tweet
Pin
Share
0 Shares

More on BloggingTips Right Now!

  • Does Changing WordPress Theme Affect Search Engine RankingsDoes Changing the WordPress Theme Affect Search Engine Rankings?

  • SEO Plugins For WordpressMost Popular and Useful SEO Plugins for WordPress SEO

  • Customize Genesis Wordpress ThemeHow to Customize Genesis WordPress Theme

  • CleanTalk Plugin - Find PluginCleanTalk — the no-CAPTCHA yet Effective Way of Spam Fighting for WordPress

About Rajesh Namase

Rajesh Namase is a serial entrepreneur, a professional blogger and internet marketer. He has a great passion in blogging and SEO.

Rajesh has written 155 awesome articles for us at BloggingTips.

  • Find Rajesh On
❮
WordPress Tips For Making Awesome Blog
WordPress Tips for Making an Awesome Blog
❯
Self Hosted WordPress Vs Free WordPress
Self-Hosted WordPress.org Vs. Free WordPress.com

 Comment Policy

Your words are your own, so be nice and helpful if you can. Please, only use your REAL NAME, not your business name or keywords. Using business name or keywords instead of your real name will lead to the comment being deleted. Anonymous commenting is not allowed either. Limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please. You can wrap code in [lang-name][/lang-name] tags.


Tell us what you're thinking... Cancel reply

If you want a picture to show with your comment, then get Gravatar!

Popular Articles

  • ☛ 11 Top Ways to Increase AdSense CPC
  • ☛ How to Increase Blog Traffic: The Complete Blog Traffic Guide
  • ☛ Cheap WordPress Hosting Options for Bloggers
  • ☛ Affiliate Marketing Vs. AdSense: Which is More Profitable?
  • ☛ WordPress SEO: Complete Guide to SEO for WordPress Blogs
  • ☛ How to Speed Up WordPress Site: Complete Guide
  • ☛ How to Monetize a Blog: Monetizing a Blog for Profit

Best Blogging Tools

• SEMrush
• Grammarly

Trending Topics

  • Blogging 83
  • SEO 25
  • Web Hosting 24
  • WordPress 33

Hot Deals

Squirrly Review

Squirrly Coupon Code: SEO Made Easier With Squirrly Pro

Get Lifetime 35% OFF on Squirrly registration. View Coupon →
Cloudways Coupon

Cloudways Web Hosting Coupon

10% discount for first 3 months. View Coupon →
  • © Copyright 2016-2021 BloggingTips. Some Rights Reserved.
  • About
  • Contact Us
  • TechLila
  • BloggingTips is built on WordPress
  • Custom Theme Using Genesis Framework
  • Cloud hosting by Cloudways