Support » Plugin: Pods - Custom Content Types and Fields » Display : error with the_fields()

  • Resolved adeline8ope

    (@adeline8ope)


    Hello,
    I have a difficulty for display my custom fields :

    • When I use the_meta(), I see the name and not the label.
    • When I use the_field(‘name_field’), I see the custom fields of one post in all posts.
    • When I use the_field(‘name_field’, the_ID()), I see the good custom fields but with a number on the start.

    Vous pouvez voir ici l’exemple montrant ces résultats.

    I use a hook of my theme (Generate Press) to add this custom fields.

    Thanks a lot

    Adeline

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor dan.stefan

    (@danstefan)

    Hi adeline8ope,

    You can’t use the_ID() to retrieve an id value, you must use get_the_ID() instead. the_ID echoes out the post id.

    Thread Starter adeline8ope

    (@adeline8ope)

    Thanks a lot to explain my mistake.
    I don’t understand why I must specify post id for the_field and not for the_meta… Can you explain that ?
    Thanks

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @adeline8ope

    As far as I know you also need to specify an ID for get_post_meta or any similar function.
    This is because these functions need context as to what meta from that object to fetch.

    Cheers, Jory

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display : error with the_fields()’ is closed to new replies.