2bak860
Member
Posted 3 years ago #
Hi,
I'm trying to get a custom field data to display in a php statement.
I'm using flickr rss and I want the part in bold to be the content of a custom field - any ideas?
<?php get_flickrRSS(array('set' => '72157601681097311', 'num_items' => 6, 'type' => 'set', 'id' => '30735063@N03')); ?>
thanks, Ross
2bak860
Member
Posted 3 years ago #
Thanks t31os_. How do I use the custom field value in my php?
<?php get_flickrRSS(array('set' => 'custom_field_value', 'num_items' => 6, 'type' => 'set', 'id' => '30735063@N03')); ?>
thanks, Ross
Which post do you want to get the meta data from? and what's the name of the custom field you want data from?
2bak860
Member
Posted 3 years ago #
Hi t31os_.
The post is the current post and the custom field is: flickr_gallery
many thanks, Ross
I'd imagine you want something like this then..
<?php
// Get post meta data
$custom_field = get_post_meta( $post->ID , 'flickr_gallery' , true );
// Check if we have data
if( $custom_field ) {
// We have data, do the thingy
get_flickrRSS( array( 'set' => $custom_field , 'num_items' => 6 , 'type' => 'set' , 'id' => '30735063@N03' ) );
}
// End if
?>