Title: get post custom function help
Last modified: August 19, 2016

---

# get post custom function help

 *  [Richard Sweeney](https://wordpress.org/support/users/theorboman/)
 * (@theorboman)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/get-post-custom-function-help/)
 * Hi,
 * I’ve got a template where I need to grab the values of several different custom
   fields associated with a post.
 * I can do this fine using the `get_post_meta` function – ie:
 *     ```
       <?php $profile_pic = get_post_meta($post->ID, 'profileimage', true);
       if($profile_pic) : ?>
       <img src="<?php echo $profile_pic; ?>" alt="<?php the_title(); ?>" />
       <?php endif; ?>
       ```
   
 * But as there are up to 3 more custom post values to get I figure it’s much more
   efficient to grab them via the `get_post_custom` function. I can’t find in either
   the documentation or via any amount of searching on Google an explanation of 
   how to retrieve the different values of the different keys using this function.
 * Can some kind soul enlighten me?!!

The topic ‘get post custom function help’ is closed to new replies.

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [get post meta](https://wordpress.org/support/topic-tag/get-post-meta/)
 * [multiple values](https://wordpress.org/support/topic-tag/multiple-values/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Richard Sweeney](https://wordpress.org/support/users/theorboman/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/get-post-custom-function-help/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
