0
votes

I know how to shuffle repeaters every time the page loads by adding this code in function.php:

// Function to randomize Advanced Custome Fields' Repeaters
function my_acf_load_value3( $value, $post_id, $field )
{
    shuffle($value);
    return $value;
}

// Randomize ACF Clients' Repeater
add_filter('acf/load_value/name=reapter-name', 'my_acf_load_value3', 10, 3);

Take note that the code above is working fine and it randomizing the repeater,But my problem is I dont know how to shuffle the SUB FIELDS inside repeater, any ideas? Thank you.

1
can you explain your question little more what mean by shuffle ? Do you want to randomize sub-fields ? this may help stackoverflow.com/questions/22011261/…Zaheer Abbas
yes exactly, I want to randomize the SUBFIELDS. By using the function above it can shuffle/randomize the repeater but not the subfield.Yinkci Heart
print_r $value what is showing ?Zaheer Abbas
Yes thanks, but actually I got the code above in that link you gave, and its working fine, it randomizing the repeater BUT not the sub fields of the repeater, what I want is to randomize the sub-fields too. Thanks anyway :)Yinkci Heart

1 Answers

0
votes

You may shuffle the sub fields values by orderby(parameter) where you are calling it. I am adding my custom code below

">">

hope it helps