Home Forums Front-end Issues get_field returns null


get_field returns null

  • Using ACF 6.1.7. Here are what I have done
    1. Use ACF to create a CPT teacher_title.
    2. Create 3 teacher titles.
    3. Create a field group Member_data, with a field Title. The field Title has field type Post Object, name author_title, Filter by Post Type teacher_title, Return Format Post ID, allow multi selection.

    Edit several users, add Title. Double checked in database, the field is there with data:
    – meta_key: author_title
    – meta_value: a:2:{i:0;s:4:”1556″;i:1;s:4:”1557″;}
    – meta_key: _author_title
    – meta_value: field_64ba8eb108835

    1556, 1557 are the post IDs of teacher title posts.

    In the page template, I simply call get_field( ‘author_title’, ‘7’ ), which 7 is the user_id which has author_title meta key.

    The function get_field returns null. I tried with get_field( ‘field_64ba8eb108835’, ‘7’ ) but nothing changes.

    Did I do something wrong here?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.