Title: Shortcode on NAV menu
Last modified: August 30, 2016

---

# Shortcode on NAV menu

 *  Resolved [nfsarmento](https://wordpress.org/support/users/nfsarmento/)
 * (@nfsarmento)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/shortcode-on-nav-menu-1/)
 * Hi,
 * I am trying to add this shortcode om my Menu ” [ip:GB]020 7267 5222[/ip] ” and
   is not working . Can someone help me with this please.
 * Thanks
 * [https://wordpress.org/plugins/shortcode-in-menus/](https://wordpress.org/plugins/shortcode-in-menus/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Gagan Deep Singh](https://wordpress.org/support/users/gagan0123/)
 * (@gagan0123)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/shortcode-on-nav-menu-1/#post-6304825)
 * **nfsarmento**
 * Which plugin is generating that shortcode?
 *  Thread Starter [nfsarmento](https://wordpress.org/support/users/nfsarmento/)
 * (@nfsarmento)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/shortcode-on-nav-menu-1/#post-6304827)
 * Thank you for your response, the plugin that I am using is this one ( IP2Location
   Tags )
 *  Plugin Author [Gagan Deep Singh](https://wordpress.org/support/users/gagan0123/)
 * (@gagan0123)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/shortcode-on-nav-menu-1/#post-6304828)
 * **nfsarmento**
 * Thanks for reporting this, issue is there in the plugin and its not working for
   this type of shortcode tags. I’m making changes in the plugin to rectify the 
   issue.
 *  Thread Starter [nfsarmento](https://wordpress.org/support/users/nfsarmento/)
 * (@nfsarmento)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/shortcode-on-nav-menu-1/#post-6304835)
 * Thank you for your fast response. Do you have any release date for that ?
 *  Plugin Author [Gagan Deep Singh](https://wordpress.org/support/users/gagan0123/)
 * (@gagan0123)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/shortcode-on-nav-menu-1/#post-6304836)
 * **nfsarmento**
 * It turns out that the plugin you are using is not using shortcodes at all. Its
   using its own custom parser to parse the content and add or delete the content
   accordingly. Here’s some custom code I’ve written that will make turn its function
   into shortcode and you’ll be able to use it in the menus(You can put this code
   in theme’s functions.php or any custom plugin you’re having on your site):
 *     ```
       add_shortcode('ip2', 'ip2_function');
   
       function ip2_function($args, $content) {
           if (isset($args['param'])) {
               $param = $args['param'];
           } else {
               $param = 'IN';
           }
           if (class_exists('IP2LocationTags')) {
               $ip2location_tags = new IP2LocationTags();
               $ip2location_tags->init();
               $content = $ip2location_tags->parse_widget('<ip:'.$param.'>'.$content.'</ip>');
           }
           return $content;
       }
       ```
   
 * This will allow parsing of shortcodes in the format
 *     ```
       [ip2 param=GB]020 7267 5222[/ip2]
       ```
   
 *  Thread Starter [nfsarmento](https://wordpress.org/support/users/nfsarmento/)
 * (@nfsarmento)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/shortcode-on-nav-menu-1/#post-6304850)
 * Hi Gagan Deep Singh
 * MASSIVE thanks your are genius, you have saved my day.
 * Thanks you.
 *  [sanjay_es](https://wordpress.org/support/users/sanjay_es/)
 * (@sanjay_es)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/shortcode-on-nav-menu-1/#post-6304877)
 * Hi Gagan Deep Singh,
    I was using your shortcode in menus plugin to show a sub-
   munu just for New Zealand users through IP2 Location shortcode. As mentioned 
   above I added the code in functions.php, but it is not working. Can you please
   guide me how to achieve this?
 *  Plugin Author [Gagan Deep Singh](https://wordpress.org/support/users/gagan0123/)
 * (@gagan0123)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/shortcode-on-nav-menu-1/#post-6304878)
 * **sanjay_es**
 * Have you installed “IP2Location Tags” plugin on your server?
 *  [sanjay_es](https://wordpress.org/support/users/sanjay_es/)
 * (@sanjay_es)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/shortcode-on-nav-menu-1/#post-6304880)
 * Thanks for your quick Response, Actually the problem got solved as client need
   the page for global also, so added the IP2 location code in the global page and
   redirected it to NZ page for NZ user. But it will be nice, If you can provide
   a solution which may be useful for others.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Shortcode on NAV menu’ is closed to new replies.

 * ![](https://ps.w.org/shortcode-in-menus/assets/icon-128x128.png?rev=1016813)
 * [Shortcode in Menus](https://wordpress.org/plugins/shortcode-in-menus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcode-in-menus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcode-in-menus/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcode-in-menus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcode-in-menus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcode-in-menus/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [sanjay_es](https://wordpress.org/support/users/sanjay_es/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/shortcode-on-nav-menu-1/#post-6304880)
 * Status: resolved