Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-23-2013, 06:20 AM   #1
eroticfem
Confirmed User
 
Join Date: Sep 2009
Location: Europe
Posts: 362
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;
__________________
eroticfem is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-23-2013, 06:31 AM   #2
Fetish Gimp
Confirmed User
 
Industry Role:
Join Date: Feb 2005
Posts: 1,699
$sponsor_link = "<a class=\"sponsor_link\" href=\"$sponsor_link_url\" target=\"_blank\">$sponsor_link_txt</a>";
__________________
Strapon Seduction - femdom blog | Twitter
Fetish Gimp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-23-2013, 06:39 AM   #3
eroticfem
Confirmed User
 
Join Date: Sep 2009
Location: Europe
Posts: 362

Quote:
Originally Posted by Fetish Gimp View Post
$sponsor_link = "<a class=\"sponsor_link\" href=\"$sponsor_link_url\" target=\"_blank\">$sponsor_link_txt</a>";
Thank you
__________________
eroticfem is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-23-2013, 06:46 AM   #4
Fetish Gimp
Confirmed User
 
Industry Role:
Join Date: Feb 2005
Posts: 1,699
Quote:
Originally Posted by eroticfem View Post
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
Fetish Gimp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.