Fetch Custom Field Values in WordPress
I find with custom post types you end up fetching custom values a lot so I wrote a set of functions to make the process easier and more efficient. This code can be included in your functions.php file. Personally I like to bring it in with an include to keep my code tidy.
You can just pass your custom field name to custom_field() or get_custom_field to have the value retrieved. It has a couple ways to format data that I find are common custom fields: dates saved as Unix timestamps, text blocks, html code, and Google Maps embed codes. And... Read More