• Resolved oysterboy

    (@oysterboy)


    Hello I have set up some custom fields for a custom post type.
    (Actually with the help of More Types& More Fields plugin).
    While the entered values are saved correctly,
    get_post_meta($post->ID, 'customFieldKey', true);
    returns nothing.
    I’m confused… Has anyone else encountered this problem?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter oysterboy

    (@oysterboy)

    url
    ..just found half the answer is that $post->ID is empty, so $post isn’t set up correctly. the_title() etc are retrieved though, just not the custom field values..

    Thread Starter oysterboy

    (@oysterboy)

    Ok, found a solution:
    adding
    global $post
    before the looped did the trick.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_post_meta returns nothing on custom post template’ is closed to new replies.