Take the 2-minute tour ×

I have looked everywhere and am not finding the answer I'm looking for.

Basically I want to access information from a post and display it on my front page.

I'm using a plugin called Advanced Custom Fields to organize my content for each post.

I can retrieve the post title like this.

$post_id = 148;
$queried_post = get_post($post_id);
<?php echo $queried_post->field_4f2af94aa1371; ?>

But I can not access the value of the custom fields. Can anyone help me?

share|improve this question
What do you get when you var_dump($queried_post)? –  David Xia Feb 16 '12 at 21:18
add comment

1 Answer

Use the get_post_meta function

<?php echo get_post_meta($post_id, 'CUSTOM_FIELD_NAME', TRUE ); ?>
  • first param: post ID
  • second param: key (name of the meta value)
  • third param: true if you want a single value (instead of array)

For more information; http://codex.wordpress.org/Function_Reference/get_post_meta

share|improve this answer
add comment

Your Answer


