• I’m using 2.0.7, and I can’t seem to force links to open in a new window, either by adding target to the anchor tag, or by using Manage Links, and choosing target=_blank.

    My template has the sidebar, header and footer all in the main index page, so I think it must be quite old.

    What could I look for that might cause this?

    TIA

Viewing 8 replies - 1 through 8 (of 8 total)
  • Damn, i´ve the same prob…

    It’s because WordPress writes correct XHTML code. “target” is deprecated, and created invalid code. If you’re using the WYSIWYG editor, it’ll strip it. Also, if your “correct invalid XHTML code” box is checked (in options) it’ll strip it.

    You can adjust your settings and create invalid code (and throw your site into quirks mode), or you can do one of two options that makes your site valid:

    1) don’t try to open links in a new window. Most people know how to do that themselves anyway, and don’t like to have their options messed with.

    2) pick up a simple javascript that allows you to open links in a new window by simply adding ‘rel=”external”‘ to your anchor tags.

    Thanks, for the quick answer!

    nguns

    Thread Starter pramclub

    (@pramclub)

    So why does the links manager include the option to open a link in a new window? (I think it’s in the Advanced section.)

    So why does the links manager include the option to open a link in a new window? (I think it’s in the Advanced section.)

    I don’t know. Maybe it already uses the script. I have no idea. I don’t open links in a new window on my sites, except on very rare occassions (and I’m sure to note that the link opens in a new window so the end user isn’t surprised).

    I have recently upgraded to WP 2.1 so I still have a few posts which have _target=blank in them. If I follow the validate XHTML link, how come it says it’s valid xhtml? It seems to produce transitional XHTML and not strict XHTML? Shouldn’t the use of _target be allowed then?

    Thanks for the XHTML hint though. Because I failed to understand why on earth this option was removed in the editor 😉

    I want to use this javascript (below) on a page link (not post) so that it just pops up the bathtub designer in a separate window. would I do this as a template and just have that script in it? how would I assign the link to use the function….?

    <script LANGUAGE=”Javascript”>

    function popupwindow(){
    window.open(“http://www.rebath.com/designBath.htm&#8221;,””,”height=625,width=680,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,left=100,top=100″)}

    </script>

    Ok- I’m an idiot.

    SO why then does the links manager even offfer the option if it’s not going to work?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Opening links in new page’ is closed to new replies.