0

How To Make Links Open In New Window(s) Or Tab(s)

  • There are many links associated with your Posts/Pages/Navbar,some of them are internal and some external and you want that whenever your readers click on such links they do not leave your blog(especially,if it's an external link to other website/blog).You can get away with this problem by making all links or individual links open in new window/tab:
    Always  backup your template before making any changes to it.

    For All  Links(Setting default new window/tab):
    Log-in and go to Dashboard-->Design-->Edit HTML and follow the instructions:
    I.This will make all links open in a separate new window/tab.Find <head>(use Ctrl+F) which is located at the top of the template HTML and add the following code-line below it:
    <base target='_blank' />
    Save the template.Done!!

    II.This will open first link clicked in new tab/window and subsequent  links clicked will open in the tab/window of first link by replacing the first link with the links so clicked.It means there will be only one new window/tab and not multiple windows/tabs.Find <head>(use Ctrl+F) and add the following code-line below it:
     <base target='_new' />
    Note:
    *If you use one of the above tricks and want to make some links open in the same window/tab then you need to add the attribute target="_self" to such links.
    *It depends on your browser's setting whether it will open in tab or window.
    *Images will also open in new window/tab.

    For Individual Links:
    You may want to make only external links , that are not related to your blog, open in new tab/window.In that case see the following instructions:

    I.If you want to make few of the links open in new window/tab then you need to add the attribute target="_blank" to such links.This will open each such link  in separate window/tab i.e.if you click two times on the link,it will open two windows/tabs and so on...For example:

     <a href="http://feeds.feedburner.com/hemmannt"target="_blank">Subscribe to E-mail</a>
    Click here for the result:Subscribe to E-mail

    II.If you want to make individual links open in new window/tab but not in separate tabs/windows for each link clicked, instead you want to replace the existing window/tab with new link clicked then you need to add the attribute target="_new" to all such links.You can replace 'new' with your tab/window name.

    0 Responses to “How To Make Links Open In New Window(s) Or Tab(s)”

    Post a Comment

    Subscribe/Join