Last Updated: February 25, 2016
·
702
· jailandrade

How display the custom post meta from a specified post

Inside the loop in Wordpress you can do

<?php
$meta_values = get_post_meta( get_the_ID() );
foreach ($meta_values as $key => $value){
    echo $key . ' : ' . $value[0] . '<br>';
}
?>

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

WordPress sites collect scripts from themes, plugins, and tag managers. A compromised plugin update can add a skimmer to every page without a change in your own templates.

Security insights from Cside