Quantcast
Channel: Forums, Blogs, Wikis » Coding
Viewing all articles
Browse latest Browse all 10

WordPress: Get custom field function

$
0
0
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); [...]

Viewing all articles
Browse latest Browse all 10

Trending Articles