Title: Custom field data in php statement
Last modified: August 19, 2016

---

# Custom field data in php statement

 *  [2bak860](https://wordpress.org/support/users/2bak860/)
 * (@2bak860)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/custom-field-data-in-php-statement/)
 * 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

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/custom-field-data-in-php-statement/#post-1419816)
 * For retrieving custom field data, see get_post_meta.
    [http://codex.wordpress.org/Function_Reference/get_post_meta](http://codex.wordpress.org/Function_Reference/get_post_meta)
 * Additional functions relating to post meta:
    [http://codex.wordpress.org/Function_Reference/get_post_custom](http://codex.wordpress.org/Function_Reference/get_post_custom)
   [http://codex.wordpress.org/Function_Reference/get_post_custom_values](http://codex.wordpress.org/Function_Reference/get_post_custom_values)
   [http://codex.wordpress.org/Function_Reference/get_post_custom_keys](http://codex.wordpress.org/Function_Reference/get_post_custom_keys)
 *  Thread Starter [2bak860](https://wordpress.org/support/users/2bak860/)
 * (@2bak860)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/custom-field-data-in-php-statement/#post-1419832)
 * 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
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/custom-field-data-in-php-statement/#post-1419869)
 * Which post do you want to get the meta data from? and what’s the name of the 
   custom field you want data from?
 *  Thread Starter [2bak860](https://wordpress.org/support/users/2bak860/)
 * (@2bak860)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/custom-field-data-in-php-statement/#post-1419882)
 * Hi t31os_.
 * The post is the current post and the custom field is: flickr_gallery
 * many thanks, Ross
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/custom-field-data-in-php-statement/#post-1419995)
 * 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
       ?>
       ```
   

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Custom field data in php statement’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/custom-field-data-in-php-statement/#post-1419995)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
