If you use a WordPress custom field to display code snippets like I do on this site, then you will notice that if you enter the full code with <\?php e.g. <?php echo get_post_meta($post-&gt;ID, ‘custom-post-name’, true); ?> It will not display as you need to tell your template to escape the special characters. To do […]
This function returns the values of the custom fields with the specified key from the specified post. This is the simplest method of simply echoing out the value of a WordPress custom field on a post or custom post. Just replace custom-field-name with the name of the desired custom field you want to echo out.