This is the code I’m trying to hack together. This returns a list of values for each field. Now I need to figure out how to add (sum) them together.
$posts = get_posts(array( 'posts_per_page' => -1, 'post_type' => 'pov_travel' )); ?> <?php if( $posts ): $dla = 0; ?> <?php foreach( $posts as $post ): ?> <?php $dla = get_field ('dla'); echo $dla; ?> <?php endforeach; ?> <?php endif; ?>
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!