Support

Account

Home Forums Add-ons Repeater Field Repeater Field – counts all rows of all posts

Helping

Repeater Field – counts all rows of all posts

  • Hello ! 🙂

    I’d like to count the total rows reapeater for all posts

    For now I have the number of rows for each post, like this:

    
      if(have_rows('my_repeater_field')) :
        $numrows = count( get_field( 'my_repeater_field' ) );
        echo $numrows.' ,' ;
        ...
    

    Result the number of rows for each post :

    
    6 ,5 ,6 ,1 ,1 ,5 ,4 ,3 ,23 ,8 ,16 ,11 ,1 ,86 ,30 ,5 ,5 ,3 ,4 ,65 ,3 ,2 ,3 ,32 , 

    is already good:p : but I’d like to count the total rows reapeater for all posts
    which should give 328 for example

    help please ! 🙂

  • You would have to first do a query to get all of the posts, then loop over those posts and get the number of rows in the repeater for that post.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.