0

I know how to show name and value of all Custom Fields

<?php the_meta(); ?>

and I know how to show one Custom Field value

<?php echo get_post_meta($post->ID, "yourkey", false); ?>

But how to show name and value of one particularly Custom Field.

1

I think what you're looking for is concatenation with .

<?php

$key = "yourkey";

echo $key . ": " . get_post_meta( $post->ID, $key, false );

?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.