eddiehowell Posted April 18, 2010 Share Posted April 18, 2010 Hi Peeps, I'm using this code. It pulls 'Featured On' information for my releases, and displays them. The problem I'm having is that if there are no values for 'Featured On', then I don't want to display 'Featured On', with nothing underneath it. Perhaps there's an 'if' statement e.g. if there is a value in 'featuredon', then echo. Does that make sense, because I'm quite new to this? <?php $values = get_post_custom_values("Featured On"); $featuredon = "Featured On"; echo $featuredon . $values[0]; ?><br> Regards Link to comment https://forums.phpfreaks.com/topic/198951-if-statement-something/ Share on other sites More sharing options...
TeddyKiller Posted April 18, 2010 Share Posted April 18, 2010 Try this $values = get_post_custom_values("Featured On"); if(!empty($values)) { $featuredon = "Featured On"; echo $featuredon . $values[0] . '<br />'; } Link to comment https://forums.phpfreaks.com/topic/198951-if-statement-something/#findComment-1044303 Share on other sites More sharing options...
eddiehowell Posted April 18, 2010 Author Share Posted April 18, 2010 Absolutely amazing, thank you so much! Link to comment https://forums.phpfreaks.com/topic/198951-if-statement-something/#findComment-1044316 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.