Support » Plugin: Shortcode in Menus » Shortcode on NAV menu

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Gagan Deep Singh

    (@gagan0123)

    nfsarmento

    Which plugin is generating that shortcode?

    Thank you for your response, the plugin that I am using is this one ( IP2Location Tags )

    Plugin Author Gagan Deep Singh

    (@gagan0123)

    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.

    Thank you for your fast response. Do you have any release date for that ?

    Plugin Author Gagan Deep Singh

    (@gagan0123)

    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]

    Hi Gagan Deep Singh

    MASSIVE thanks your are genius, you have saved my day.

    Thanks you.

    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

    (@gagan0123)

    sanjay_es

    Have you installed “IP2Location Tags” plugin on your server?

    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.