Before you ask please READ THIS

Adding a Target="_blank" to single-works.php

edited September 2013 in Beach Please Posts: 10
im looking on line 46 i think -what is the proper code to make visit site buttons open a new window? thanks

Comments

  • AirAir
    Posts: 10,970
    Hello

    Forcing new window is considered bad practice. Anyway you are in right place so just add it and it should work. Look out for not closed quotes.

    With regards.
  • edited September 2013 Posts: 10
    just curious, why is it bad practice?

    here is your code

    echo '<a class="project-site" href="'.$temp.'">'.__fe('Visit Site').'</a>';

    im trying to add it but not working...
    Post edited by Air on
  • AirAir
    Posts: 10,970
    Agent8 said: just curious, why is it bad practice?
    Google it:-) In short you don't give user choice if he want new tab/window or not. And not giving user choice about his environment is usually bad practice.
    Agent8 said: here is your code
    No need to show my code, show my yours:-) I don't see in your code added proper code.
    Use this
    
    echo '<a class="project-site" href="'.$temp.'" target="_blank">'.__fe('Visit Site').'</a>';
    
    With regards.
  • ya i googled it - understand now :) thanks ---
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!