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.

 

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help.

 
Thread Tools
Old 03-12-2012, 12:46 AM   #1
dgraves
Confirmed User
 
dgraves's Avatar
 
Industry Role:
Join Date: Nov 2005
Location: Scottsdale
Posts: 2,283
Code Help

hey guys, i need some help with some code. what code would i use if i only wanted to show "Cumshots" when there is a value entered? i tired:

<?php if((get_post_meta($post->ID, "shots", true)) ) { ?>

but it didn't work.

<td><span>Name:</span> <? echo $name ?></td>
<td><span>Video:</span> <? echo $video ?></td>
<td><span>Pictures:</span> <? echo $pics ?></td>
<td><span>Cumshots:</span> <? echo $shots ?></td>
dgraves is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-12-2012, 02:38 AM   #2
rweb
Registered User
 
Industry Role:
Join Date: Feb 2012
Posts: 24
I assume you're talking about WordPress.

I don't know what are the $name, $video and $pics variables in your code, but if you have a custom field named 'shots' and you want to display it's value if it exists, then this works:
PHP Code:
<?php
$shots 
get_post_meta($post->ID"shots"true);
if(
$shots) {
?>
  <td><span>Cumshots:</span> <? echo $shots ?></td>
<?php
}
?>
rweb is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-12-2012, 12:39 PM   #3
dgraves
Confirmed User
 
dgraves's Avatar
 
Industry Role:
Join Date: Nov 2005
Location: Scottsdale
Posts: 2,283
awesome, thanks for your help. i'll give this a try.
dgraves is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
 
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.