• Resolved Hasitha Prabath

    (@hasitha-prabhath)


    I found 2 codes for wordpress custom fields. Both are working fine but I like to know difference between these 2 codes.

    Code 1
    <?php echo get_post_meta($post->ID, ‘1’, true); ?>

    Code 2
    <?php $values = get_post_custom_values(“1”); echo $values[0]; ?>

    (sorry for my bad english)

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Code for Custom Fields’ is closed to new replies.