WordPress.org

Ready to get started?Download WordPress

Forums

External links in separate pages (7 posts)

  1. DomFel
    Member
    Posted 9 years ago #

    What code should I add to the files of the wordpress installation (or style.css of the template I'm using) in order to make all the external links of my website to open up in new windows?
    Thanks a lot for your help.

  2. orangeguru
    Member
    Posted 9 years ago #

    The easiest way is to do it in the href directly:

    <a href="http://www.somewhere.com">Going somewhere</a>

  3. jafer
    Member
    Posted 9 years ago #

    maybe orange is talking about 'Going somewhere' with target="_blank"

    who knows?

  4. mitchpowell
    Member
    Posted 8 years ago #

    DomFel wants all his external links to open in a new window.

    So do I.

    orangeguru doesn't resolve the issue very well at all.

    jafer comes along and asks if orange meant to put 'target="_blank"' into the tag.

    That would resolve it, yes. But what's this about XHTML-strict?

    Is there something better to use for XHTML compliance?

    Is it rel="external"?

    How could you cull out all the external links you've made in previous posts and assure that they have the appropriate (XHTML-compliant) instruction to open in a new window (or a new tab)?

  5. Beel
    Member
    Posted 8 years ago #

    I'd use a search and replace on links in the post table.

    The code I have posted before is javascript that will open a new window in all links that have rel="external" in them.

  6. mitchpowell
    Member
    Posted 8 years ago #

    You mean by administering the post table directly in phpMyAdmin?

    And where is this JavaScript you have posted before?

  7. Beel
    Member
    Posted 8 years ago #

    That would be the easiest way, or you could write your own script.

    here is one place I posted it (there are several now):
    http://wordpress.org/support/topic/6642#post-39860

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.