Support

Account

Home Forums General Issues Get custom post type fields value in theme with code

Solving

Get custom post type fields value in theme with code

  • Hello all,

    I have to build a theme with acf i have a homepagina setup with acf but without custom pos type what was easy. But the tricky part is that is cannot get the fields value from custom post type in my theme. Any help?

  • get_field() will only work on the pages of the custom post type. This is more to do with what loops are running on which pages.

    You can access those fields a couple ways, by using get_field( ‘field_name’, ‘ID of CPT post’ ) or you can loop through using a wp_query loop and get those fields from that Custom post type.

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

You must be logged in to reply to this topic.