Support » Fixing WordPress » target = blank not working

  • Here is a link to my site

    I’ve edited the footer.php to include a link to a webstats provider I use. That went in fine (using Dreamweaver to insert the code).

    But – I want to go back and put in the target=blank so the stats open in a new window.

    In WP Dashboard, if I try editing footer.php it says the file is not writeable, but the permissions are set at 755. I am able to open and save changes using Dreamweaver but for some reason the target=blank isn’t working.

    I went back in through Dashboard and I can see the code. But, it won’t work!

    What am I overlooking? Why won’t it open in a new window?

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • I edited your code and it worked fine for me.
    Not sure if you know, but you actually have TWO links to those stats

    1) The basic link for people with Javascript:

    <a href="">

    2) The no-script for people without Javascript
    <noscript> <a href="" target="_blank" > <img src="" border=0 alt=" Free Web Stats!">Web Stats</a> </noscript>

    You have added the target=blank ONLY to the no-script, for those without Javascript.
    So if you HAVE Javascript enabled in your browser then you are seeing the link 1) above WITHOUT the target=blank.
    SO you need to add that to both links.

    You can (and should really) test both links.. by having Javascript enabled in your browser, then disabled (refresh page after changing).
    Try disabling Javascript in your browser before editing any more code, the link will open in a new tab as you want. Just edit the other link, enable Javascript again refresh and you will be good to go!

    <a href="" target="_blank">

    Hey Greg,

    Thanks for the response. I have edited the code to include target=blank in both scripts – but still, when I click on my adfreestats symbol in the footer, keeps using the same window…. can I trouble you to look again and see if I got the code correctly placed in both areas? Thanks much!

    No problem.

    You have put it in the script tag
    <script target="_blank" src="" type="text/javascript">

    So remove the target=”_blank” from that tag (as above) and add it to the <a href just underneath that
    <a href="">

    A <a href=""> is a link, and it’s the links you assign the target blank to so the link opens in a new tab (or page).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘target = blank not working’ is closed to new replies.