• Resolved swall73

    (@swall73)


    Good Day

    I have read your support forum for the ACF Fields and how to be able to use them in a shortcode however I believe I am missing some part of the shortocde for this to work .

    In a previous thread you mention to use [vg_display_data key=”acf_field_key”] and replace the acf_field_key with the relevent key however I do not know how to establish what the data source will be in order to have this correct data_source=”????”

    Can you help explain this a little more please.

    Many Thanks Regards
    Stephen

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jose Vega

    (@josevega)

    Hi Stephen

    ACF saves the values as meta data usually, so the data source should be post_meta or user_meta depending on what you need.

    For example, this will show the ACF value for the current post: [vg_display_data key="acf_field_key" data_source="post_meta"]

    Thread Starter swall73

    (@swall73)

    Hi Jose

    Thank you so much for help.

    Unfortunately I have not had success with user_meta or post meta.

    I read on the ACF website and it states the following :

    “In ACF 5, there are two post types “acf-field-group” and “acf-field”. the acf-field post type are child posts of the acf-field-group post type. First you need to find the parent group ID and then search for acf-field posts with that parent id. The group and field information are both saved in the post table post_content column as serialized arrays, again, be careful editing this.”

    Could this be part of the problem?

    Regards
    Stephen

    Thread Starter swall73

    (@swall73)

    Hi

    I have managed to sort this out. I was using the incorrect ACF Field Key . The source is user_meta

    Thank you for the prompt support. Really appreciated

    Regards
    Stephen

    Hi! This seems to work well, thanks for this question & answer!

    However, this shows the data of current user. Is it possible to show for example acf_field_key of post author (instead of currently logged in user) in the post itself, dynamically?

    Nvm, got it working with Posts Snippets plugin, by making custom short code that gets the data from post author.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to use ACF Fields’ is closed to new replies.