WordPress.org

Ready to get started?Download WordPress

Forums

Opening Link is new tab (12 posts)

  1. sreenadh
    Member
    Posted 8 years ago #

    In all the WP themes i use, when i click a Link. It opens up in the same tab.
    Is it possible to open the page in a new tab.

    NOTE: I am using Firefox.

  2. moshu
    Member
    Posted 8 years ago #

    Right click and select Open Link in New Tab.

  3. pizdin_dim
    Member
    Posted 8 years ago #

    Short and sweet reply, moshu.

    I think what sreenadh was asking is how can I (the developer) force the link to open in a new tab. If that's the question, the answer is:

    You can't.

    As you probably know, you can use "_blank" for the target attribute to open a link in a new window but not in a new tab. In any case the target attribute is depreciated and probably for a good reason:

    Clicking on links which don't show the results in the current window is almost always confusing for the users.

  4. Ajay
    Member
    Posted 8 years ago #

    target is depreciated only in XHTML 1.1 and XHTML 1.0 Strict not in XHTML 1.0 Trans or below.

  5. flammobammo
    Member
    Posted 8 years ago #

    This may be a botchy solution possibly worth considering for old links: using the Search and Replace feature in wp-admin to search for:

    <a href="

    and replace it with

    <a target="_blank" href="

    That way any links without the new page/tab code will now have it, although I'm not sure if it's bad to have it double tagged, and it certainly is only good for a once off "clean-up" if you're now using the blank tag, and want to clean up old posts.

  6. Ajay
    Member
    Posted 8 years ago #

    You can do what flammobammo did above, but before that replace target="_blank" with (space or nothing) so that you don't get a repeated attribute.

  7. sreenadh
    Member
    Posted 8 years ago #

    target="_new" will open a link in new tab for firefox.

  8. flammobammo
    Member
    Posted 8 years ago #

    Sweet sreenadh, I'm going to use that from now on, and replace all my "_blank"'s !! Cheers!

  9. Ajay
    Member
    Posted 8 years ago #

    sreenadh, how does IE take it?

  10. pizdin_dim
    Member
    Posted 8 years ago #

    target="_new" will open a link in new tab for firefox.

    What the hell is that? W3C lists 4 reserved: _blank, _self, _parent and _top and makes no mention of _new:

    http://www.w3.org/TR/REC-html40/types.html#type-frame-target

    That makes _new illegitimate, no? Unless you can point me to the right page at W3C?

    I have just tried it and it doesn't work. It will open a new browser instance, not a new tab. In fact, you can try anything as the target (_old, _broken, _crap, whatever), it makes no difference as anything other then _self, _parent and _top is interpreted as _blank and therefore a new page.

  11. Class
    Member
    Posted 8 years ago #

    If a _NEW/_BLANK link opens in a new tab or same tab depends on how the browser (that use tabbed browsing) are set up, IE and other non-tabbed browsers will open them in a new window.

  12. pizdin_dim
    Member
    Posted 8 years ago #

    "If a _NEW/_BLANK link opens in a new tab or same tab depends on how the browser (that use tabbed browsing) are set up"

    That's right, Firefox (1.5) gives you the configuration choice of "new window", "a new tab in the most recent window" and "the most recent tab/window".

    But as I was trying to show, this has nothing to do with target="_new", it's a browser thing only. The target value can be almost anything, as long it's not only numbers (I think). There is no need to have the leading underscore.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.