Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #793

    Can the twitter, facebook and flickr icons in the footer be linked with “target=blank” so they open in a new tab/window.

    I assume changes will have to be made in footer.php in lines 23-30.

    Could anyone help, please! My php-knowledge is just not sufficient :-(

    Thanks!

    #32895

    Yes – in footer.php you’ll find following code:

    if($k_option['includes']['acc_fb'] != '')
    echo "<li class='facebook'><a class='ie6fix' href='http://facebook.com/".$k_option['includes']['acc_fb']."'>Facebook</a></li>";

    if($k_option['includes']['acc_tw'] != '')
    echo "<li class='twitter'><a class='ie6fix' href='http://www.twitter.com/".$k_option['includes']['acc_tw']."'>Twitter</a></li>";

    if($k_option['includes']['acc_fl'] != '')
    echo "<li class='flickr'><a class='ie6fix' href='http://www.flickr.com/people/".$k_option['includes']['acc_fl']."'>flickr</a></li>";

    replace it with:

    if($k_option['includes']['acc_fb'] != '')
    echo "<li class='facebook'><a target="_blank" class='ie6fix' href='http://facebook.com/".$k_option['includes']['acc_fb']."'>Facebook</a></li>";

    if($k_option['includes']['acc_tw'] != '')
    echo "<li class='twitter'><a target="_blank" class='ie6fix' href='http://www.twitter.com/".$k_option['includes']['acc_tw']."'>Twitter</a></li>";

    if($k_option['includes']['acc_fl'] != '')
    echo "<li class='flickr'><a target="_blank" class='ie6fix' href='http://www.flickr.com/people/".$k_option['includes']['acc_fl']."'>flickr</a></li>";

    please be aware that this is NOT a W3C valid solution. The attribute target=”_blank” is forbidden for xhtml strict.

    A better solution would be using a javascript like I posted in this thread: http://www.kriesi.at/support/topic/how-to-open-all-external-links-in-new-windows

    The Dude

    #32896

    Cool! Thanks a lot for your speedy reply! Much appreciated!

    I used this:

    jQuery("a[href^='http:']").not("[href*='mydomain.com']").attr('target','_blank');

    Works like charm

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Can the twitter, facebook and flickr icons be linked with "target=blank" ?’ is closed to new replies.