WordPress display the_meta() of in custom page

enter image description here

I have some meta values on my wordpress custom page that I need to be displayed in a table. Is there any way I can do that.

Here’s the code I’m using now: <?php the_meta(); ?>

And this is what it shows:

enter image description here

I want to do something like:

enter image description here

I found out that:

the_meta() is located in wp-includes/post-template.php

This makes the output:

<ul class='post-meta'>
<li><span class='post-meta-key'>your_key:</span> your_value</li>


So it’s not recommended to edit files in that folder because of the wordpress update.

You can make a table in html and display each value individually, like this:

<?php echo get_post_meta($post->ID, 'Yout key', true); ?>


Here‘s the documentation or https://codex.wordpress.org/Using_Custom_Fields

Also published on Medium.

Leave a Reply

Your email address will not be published. Required fields are marked *