On several WordPress projects I've needed to get the value of a custom field. Not too difficult using the get_post_meta command, but I wanted a little quicker way. So I now add this little function to the functions.php file on themes I'm working on. PLAIN TEXT PHP: function getMeta($key) { global $post; return get_post_meta($post->ID, $key); [...]
↧