Uploading images via ACF update_field function

Should anyone come across the same issue, I found that when creating the $gallery_data array I was creating an array of arrays instead of key value pairs, I ended up just running the update_field function inside a foreach with the add_image key value pair created. $gallery_img_id = rudr_upload_file_by_url($gallery_img[“original_path”]); $acf_gallery_slug = “gallery_image_” . $counter; $add_image = … Read more

WordPress duplicating posts from single loop

Unless I’ve mis-interpreted what you are trying to accomplish, you added the foreach loop and you don’t need it. Having it run while inside a while loop seems to be duplicating your intentions. Remove the foreach loop altogether, delete the first wp_reset_postdata();, and un-comment the 2nd one: <div id=”carouselTestimonial” class=”carousel slide” data-bs-ride=”carousel”> <div class=”carousel-inner”> <?php … Read more

WordPress custom post type -> query and sort by custom field with multiple values, then published date

You can use the relation = OR in your meta_query args. Something like this: $args = [ ‘post_type’ => ‘blogs’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 24, ‘meta_query’ => array( ‘relation’ => ‘OR’, ‘featured_clause’ => array( ‘key’ => ‘featured_post’, ‘value’ => ‘yes’, ‘compare’ => ‘=’ ), ‘not_featured_clause’ => array( ‘key’ => ‘featured_post’, ‘value’ => ‘no’, ‘compare’ … Read more

How to capture number input from wordpress form into acf field in woocommerce

Try using the wpuf_add_post_after_insert hook. This hook gets triggered right after a post is created using WPUF, which means it might be a more appropriate time to save additional data, like the phone number: add_action(‘wpuf_add_post_after_insert’, ‘update_product_acf_field_guest_submission’, 10, 3); function update_product_acf_field_guest_submission($post_id, $form_id, $form_settings) { // Check if the form ID matches the specific form where the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)