Home › Forums › General Issues › Imported Field post_meta not displaying on front-end › Reply To: Imported Field post_meta not displaying on front-end
Well.. I decided to just run an init query through every post and add the field values back into themselves. Here’s a snippet of what I used: (add once to functions, refresh /wp-admin, delete code)
function process_post() {
$my_posts = get_posts( array('post_type' => 'page', 'posts_per_page' => -1 ) );
foreach ( $my_posts as $my_post ) :
$value = get_field('field_560094b2af64e', $my_post->ID );
if($value):
update_field( 'field_560094b2af64e', $value, $my_post );
endif;
endforeach;
}
add_action( 'init', 'process_post' );
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.