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

    (@gagan0123)

    Sorry for the delayed reply,

    All you need to do is, write the shortcode instead of url while adding new custom link in the menu

    Plugin Author Gagan Deep Singh

    (@gagan0123)

    Here’s a link to a screencast I made for your help (no audio, but you’ll get it easily)
    [video src="https://gagan.pro/Adding-Shortcode-in-Menus.m4v" /]

    Hate to break it to ya bud…but it doesn’t work. I’ve tried several shortcodes and the only link that shows up is the current page url in there. Doesn’t display the one that it is supposed to. WordPress 4 here.

    The shortcode I’m trying to use has added defining elements in it using “”. Don’t know if that breaks it. It isn’t just a simple shortcode enclosed in brackets.

    Plugin Author Gagan Deep Singh

    (@gagan0123)

    @kahil:

    Can you please mention the shortcode you’ve used and the plugin/code responsible for that shortcode?

    Sure…

    The plugin for that shortcode is “User meta shortcodes”. It allows me to call specific data from the currently logged in user’s metadata. In this case I am using the user website for a specific link. I want to call that link into a menu. That plugin allows me to display the link, but I want that link in a menu item so I can display in anywhere I want.

    That’s where your plugin comes in. It’s a convoluted way of getting that user meta data into a menu item…but I can’t think of any other solution short of someone actually creating a new menu item section to pull form in the menu builder that does just that…calls user metadata.

    In this case, the shortcode of [authorinfo field=’user_url’] isn’t working. Just calls the link of whatever page you’re on.

    Plugin Author Gagan Deep Singh

    (@gagan0123)

    @kahil:

    Thanks for providing me with the info, as for the plugin goes, currently it only enables you to output the URL and not the whole HTML Output. I tried earlier to provide a more elegant solution to this problem, but haven’t been able to make any progress with it because of the things involved while creating a new section for existing nav menus, though I was able to work out a simple patch type solution which I implemented in one of the user who was having similar type of problem. I guess until I find the perfect working method, I should add that patch to the plugin for the time being so that users wanting this particular functionality can work this out. I’m about to release a new version of the plugin in a few minutes, I’ll explain the steps involved for having complete HTML outputs in the navigation menu; in the description of the plugin.

    It isn’t ouputting the whole HTML output. It just displays the text that is entered into that field of the user data. If I use it in a page, it just displays whatever text is entered into the field, not the full html output for displaying a link. So that’s why I thought it should work as it would be just like putting the text in the custom menu section myself.

    Plugin Author Gagan Deep Singh

    (@gagan0123)

    @kahil

    Before writing the reply I tested my plugin with the one you are using for short codes. Here’s the output I got when I used it:

    <span class="userinfo">https://gagan.pro/something</span>

    So this span is the thing that wasn’t accommodated properly. Thats why your case needs to output Full HTML and can’t work with the current version of the plugin.

    Let it be, I’m almost done with it, just testing it out if it works properly or not with. Plugin should be up in 5 – 10 minutes

    OH…yeah….sorry…forgot to mention that I edited that other plugin to remove the span wrapper and just display the field content.

    Plugin Author Gagan Deep Singh

    (@gagan0123)

    @kahil

    I just read the documentation of the plugin you are using, you can also simply use this short code that will work correctly:

    [authorinfo field='user_url' nospan='true']

    I know. Just wanted to keep it simpler. But either way, it still won’t work with your plugin.

    Plugin Author Gagan Deep Singh

    (@gagan0123)

    @kahil

    I’ve been able to use the shortcode I sent you successfully on my testing server without any modification to the plugin. Though when I tested with some other themes, namely Twenty Fourteen, it didn’t worked well, reason being, the navigation was being called before even logged in user was initialised (thats about the primary menu, in secondary menu, it worked just fine). Might be similar thing is happening on your side. I can help you out to debug it if you want.

    ok, what’s your fix?

    Ok… If I put in “FULL HTML OUTPUT” it does show the url as text….but…it just displays that as plain text. It isn’t a clickable link. Kinda defeats the point of using the plugin if I want to use it as a menu item, but it isn’t clickable. I need it to let me name the link text whatever I want and be clickable with the user url.

Viewing 15 replies - 1 through 15 (of 30 total)
  • The topic ‘How does it work?’ is closed to new replies.