I have a while loop that fetch me all the posts in a specific category,
Now I have add the custom values but the problem is that it only echo out the value of the custom field and not the name,
The function i use for printing out the value is
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
the_meta();
<?php endwhile; endif;?>
Now I have tried to echo out the get_post_custom_keys($post->ID);
but that only gives me the output "array"
I also tried a foreach loop, but it only gave me the name of the last post
$meta_key_used = get_post_custom_keys($post->ID);
foreach ($meta_key_used as $meta_key) {
echo $meta_key;
Any ideas on how to print out the name of the custom field ?
If you have all the post IDs that you want to call it for, then you could do this…
This excludes any WordPress internal keys where the value begins with an underscore.