Forums

Custom Field Retrieval (2 posts)

  1. RockyMtnHi
    Member
    Posted 1 year ago #

    I am using this code to retrieve custom field values and they are not being retrieved:
    echo get_post_meta($post->ID, 'quote', true);

    Is there anything special about how to do this? It am using this method successfully on other sites.

    Thanks in advance for the help.

  2. vtxyzzy
    Member
    Posted 1 year ago #

    The syntax you showed will work inside the Loop where the $post object is available. If you want to use it outside the Loop, you will need to supply the ID differently.

Topic Closed

This topic has been closed to new replies.

About this Topic