the_meta()
Deprecated from version 6.0.2. It is no longer supported and can be removed in future releases. Use
get_post_meta() to retrieve post meta and render manually
instead.Display list of post custom fields.
Uses: get_post_custom_keys()
1 time — 0.001464 sec (very slow) | 50000 times — 2.87 sec (fast) | PHP 7.1.2, WP 4.7.3
Hooks from the function
Return
null
. Nothing.
Usage
the_meta();
Examples
#1 Display the metadata of the post
To do this, place the following code in the file single.php after the template tag (function) the_content()
<p>Meta information about the current post:</p> <?php the_meta(); ?>
This code will output the following
<p>Meta information about the current post:</p> <ul class='post-meta'> <li><span class='post-meta-key'>key name:</span> field value</li> </ul>
Changelog
Since 1.2.0 | Introduced. |
Deprecated since 6.0.2 | Use get_post_meta() to retrieve post meta and render manually. |