Forums

[resolved] Custom Fields (3 posts)

  1. Vizionn
    Member
    Posted 3 years ago #

    I can't get the custom fields to work at all (when using anything other than the_meta()

    I would like to get the value for the key sub-banner

    I tried using:
    get_post_meta($post_id, $key, $single);
    with many varients, $key=sub-banner, sub-banner etc but nothing was rendered.

    Can anyone help?

    Thanks, Andy

  2. yoshi
    Member
    Posted 3 years ago #

    get_post_meta() doesn't echo like the_meta().
    You need to print the returned value.

    echo get_post_meta($post_id, 'sub-banner', true);

  3. Vizionn
    Member
    Posted 3 years ago #

    Thanks a bunch, will try it out :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.