How to display all custom fields associated with a post?

you can use get_post_custom() which returns a multidimensional array with all custom fields of a particular post or page:

echo '<pre>';
print_r(get_post_custom($post_id));
echo '</pre>';

Leave a Comment