Hello everyone and thank you very much for the help
I have a code that brings me all the fields from all the posts in the following way:
// Get arguments for all posts
$args = array(
'posts_per_page' => -1,
// Create the array for all posts
$all_posts = array();
// Set up the query
$the_query = new WP_Query( $args );
// Setup the loop
if ( $the_query->have_posts() ):
while ( $the_query->have_posts() ): $the_query->the_post();
// Get all fields
$fields = get_field('number');
// Push each $fields array into the $all_posts array
// Restore original Post Data
// Print the result here and do what you choose
Now what I’m trying to do is to connect all the “number” fields. I found that if I have 3 in post 1 and 3 in the second post, then the result will be 4 connecting all the posts according to this field. Does anyone have an idea?
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users