I want to place a post before all others from an ACF boleen field

It looks like you’re clearing the queried posts by setting the posts var to an empty array. $queryRecipesGrid = new WP_Query( $argsRecipesGrid ); // first you get the posts here /** partie de code Richardson **/ $queryRecipesGrid = array(); // then you wipe them out by setting the same var to empty array. Regarding the … Read more

Multipe array in meta_input

In your 2nd code snippet, you’re redefining $post_args for each $movie. Try this instead: $post_args = array(); foreach($movies as $movie) { $i++; $post_args[] = array( array( ‘key’ => ‘title’ . $i, ‘value’ => $movie[‘title’] ), array( ‘key’ => ‘qty’ . $i, ‘value’ => $movie[‘qty’] ), array( ‘key’ => ‘desc’ . $i, ‘value’ => $movie[‘desc’] ) … Read more

How to get files from loop for zip

As the files are within the same WP installation (not a remote), you don’t need to download the file using get_file_contents(), try to add the file using its absolute path of the attachment. if(isset($_POST[‘download’])){ $tmpFile = tempnam(‘/tmp’, ”); $zip = new ZipArchive(); $zip->open($tmpFile, ZipArchive::CREATE); foreach( $list_posts as $list_item ) : if ( $list_item->post_type == ‘crb_photo’ … Read more