WordPress accessing custom fields in code

|
| By Webner

In WordPress you can use following code for accessing value of custom fields:

$key_name = get_post_custom_values($key = 'Key Name');
echo $key_name;//display the value

Here ‘key name’ is name of the custom field.

get_post_custom_values() is a function in WordPress, which is used to get the custom value of a field which is stored in a variable $key_name.

Webner Solutions is a Software Development company focused on developing CRM apps (Salesforce, Zoho), LMS Apps (Moodle/Totara), Websites and Mobile apps. If you need Web development or any other software development assistance please contact us at webdevelopment@webners.com

Leave a Reply

Your email address will not be published. Required fields are marked *