ACF Template Builder

Enabling and adding acf values that belong to another post

One of the things you can do easily using the ACF Template Builder is get the value of another postid's field. You can get any available field you want!

You will have to activate the postid attribute for the shortcodes. This is a small code-snippet that needs to be added to the functions.php file located in your theme-directory.

add_filter( 'bbacf/helpers/sc_attr/type=default' , 'add_postid_sc_attribute' );

/**
 * add the postid attribute to the default sc attr
 * @param  [type] $array [description]
 * @return [type]        [description]
 */
function add_postid_sc_attribute( $array ) {
	return array_merge(
				$array,
				array(
                    'postid'		=> null,
                    )
 			);
}

After having enabled the postid attribute you can add the postid to your shortcode attributes.

[ bbacffield field="cover" postid="212" size="thumbnail" align="none" ]

will get the acf-field cover from the postid 212, even when that's not the postid for the current page.

Viable applications

using this you could use a page that is set to be private, has a fieldgroup attached that is comprised of several overal settings. If you want to use any of those settings, company logo or seasonal background, message or anything, you can use that on all your templates or temporarily change all instances of a shortcode.

[demo video will be here soon]