Get custom field data

<?php

//Get custom field string:

$my_field = get_post_meta($post->ID, 'myCustomFieldName', true); ?>

echo $my_field;

//Get custom field array:

$my_field = get_post_custom_values("myCustomFieldName'");

echo $my_field[0];

?>

0 Comments

You must be logged in to post a comment.