• Resolved trial3rror

    (@trial_error)


    Hi,

    When I go to Appearance->Menus and use the Links section to create a menu item, I can enter
    http://example.com
    and it renders as
    <a href="http://example.com"></a>

    I would like the link to open in a new tab and thus need to add the attribute
    target="_blank".
    But no matter how I try to add it, WP renders a link that resolves erroneusly.

    For instance, I would think that entering
    https://example.com" target="_blank or
    https://example.com"%20target="_blank (I use the htmlentity & quot ;, not the ” but the forum converts it when I write it in my post)
    instead of simply the URL, would be renderded by WP as follows
    <a href="http://example.com" target="_blank">.

    But the HTML rendered looks like this and the link does not work at all
    <a href="https://example.com"%20target="_blank"></a> Here the HTML rendered renders the two middle ” as I enter them as HTML entity code and the first and last as “. Weird.

    I dont understand why this does not work, or the different interpretation of ” and the HTMLentity & quot ;.

    Does anyone have a clue how to open a link in a new tab from a menu link?

    (If I type ” instead of the ” when entering my string the quoatation marks bet stripped away when I save the menu.)

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

The topic ‘using target="_blank" in menu link ?’ is closed to new replies.