WordPress Custom Fields

Get custom field outside the WordPress loop

Do you want to get a custom field outside the WordPress loop (e.g. in your sidebar) and you have no idea how? The following code snippet will help you do it. * Replace the ‘customField’ in the 4th line with the name of your custom field. <?php global $wp_query; $postid = $wp_query->post->ID; echo get_post_meta($postid, ‘customField’, […]

read more

Get WordPress Custom Field if it exists

If you want to get a custom field anywhere in your posts/pages accompanied by a phrase indicating that the output is something specific (e.g. you have a showcase and you want to include the showcased site’s url under the image but you want it styled specifically) then all you have to do is insert the […]

read more