Support

Account

Home Forums General Issues Need custom field data repeated across entire site

Solving

Need custom field data repeated across entire site

  • I’m working on an existing site that has custom fields setup for the home page (top banner area). I want the same scheduled content to be on the rest of the site as well. Not adding fields to all pages but the custom field info for the home page to be repeated across the entire site. IT looked at the repeater plugin but its not clear that it does what i’m looking for. Thanks!

  • The repeater add on is not what you’re looking for. The repeater creates a field that lets you add rows of information, not repeat something on other pages.

    If you want to be able to set something and use it on every page of a site then the best thing to look at is the options page. It could also be done by getting the values stored on the home page. You’re also going to need to rework all the template files on the site either way.

  • Thank you, I figured i’d need to update the template files, however i’m just not clear on the best code to use to pull the data from the home page values.

  • What you need to do is supply the post id. You can either hard code it or you might be able to get it dynamically by accessing the WP page on front value if you have this set http://wordpress.stackexchange.com/questions/165374/how-to-get-post-id-of-static-front-page

    $post_id = GET OR SET POST ID
    get_field(‘my_field’. $post_id)

    See the “Get a value from a specific post” section of https://www.advancedcustomfields.com/resources/get_field/

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

The topic ‘Need custom field data repeated across entire site’ is closed to new replies.