Need help with code!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eroticfem
    Confirmed User
    • Sep 2009
    • 362

    #1

    Need help with code!

    How do i add to this code that the link(s) opens in a new window?

    Code:
      $sponsor_link_url = get_post_meta( get_the_ID(),'sponsor_link_url',true);
      $sponsor_link_txt = get_post_meta( get_the_ID(),'sponsor_link_txt',true);
    
      $sponsor_link = "<a class=\"sponsor_link\" href=\"$sponsor_link_url\">$sponsor_link_txt</a>";
    
      echo $sponsor_link;
  • Fetish Gimp
    Confirmed User
    • Feb 2005
    • 1699

    #2
    $sponsor_link = "<a class=\"sponsor_link\" href=\"$sponsor_link_url\" target=\"_blank\">$sponsor_link_txt</a>";
    Strapon Seduction - femdom blog | Twitter

    Comment

    • eroticfem
      Confirmed User
      • Sep 2009
      • 362

      #3
      Originally posted by Fetish Gimp
      $sponsor_link = "<a class=\"sponsor_link\" href=\"$sponsor_link_url\" target=\"_blank\">$sponsor_link_txt</a>";
      Thank you

      Comment

      • Fetish Gimp
        Confirmed User
        • Feb 2005
        • 1699

        #4
        Originally posted by eroticfem
        Thank you
        No problem

        And a personal tip, I prefer using heredoc syntax over having to escape quotes.

        So you could rewrite that code as

        Code:
        $sponsor_link = <<<EOT
        <a class="sponsor_link" href="$sponsor_link_url" target="_blank">$sponsor_link_txt</a>
        EOT;
        Strapon Seduction - femdom blog | Twitter

        Comment

        Working...