Support

Account

Home Forums Front-end Issues how to get values for post type in archive taxonomy page

Helping

how to get values for post type in archive taxonomy page

  • Hello

    I have CPT called [Products] with custom taxonomy [categories]
    and i make 4 fields in products posts

    2 text area, call [prefs,more_details]
    1 text input, call [discount]
    1 radio button, call [availability]

    I want to get those values for products in archive taxonomy page to all products
    also for single product page.

    Any Help ?

  • Hi @islam

    You can be able to load values from an archive page by adding a second parameter to the get_field() and the_field() functions. This second parameter will contain the correct ID which can be found using get_option(‘page_for_posts’)

    It will look something like this:

    the_field('heading', get_option('page_for_posts'));

    You can also refer to this topic for more examples.

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

The topic ‘how to get values for post type in archive taxonomy page’ is closed to new replies.