I figured it out using a While loop and an If statement with a counter. This solution uses functions from Advanced Custom Fields;
$i = 0;
while have_rows('week_rows') ): the_row();
$i++;
if( $i == 5 ) { // stops on the 5th row of 'week_rows' array
break;
}
endwhile; // I had to move the endwhile up before my display statements
// add display statements here to display array contents from 5th array row
?>
Related Posts:
- Can an array be used as a meta_query value?
- How can I add multiple ‘tax_query’ arrays via a loop?
- Advanced Custom Fields – display label and value only if value entered
- Conditional multidimensional arrays and array_map
- ACF – Get ID of relationship field in flexible content
- Make sticky post with FacetWP
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Custom WordPress Function – Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
- Download PDF after CF7 form submission
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- How can I access string value in an array?
- How to use if statement in an array? [closed]
- How to array only one key from another array
- Filtering a function’ output for a new continued function
- How to create an ACF shortcode with Repeater Field in WordPress? [duplicate]
- Get html data with javascript to php array and store to wordpress database
- How do I create a numbered list with PHP? [closed]
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- How to use array in function to get only value I want
- Error while setting role
- Get categories names as an array to use it in theme settings
- Upload non-featured image to image field
- How to get the last category name of a child category?
- How to say if meta_value is greater than 0 in an array?
- How to use two meta_compare in an array?
- Warning: in_array() null given in PHP function
- HTML Special Characters in URL string [closed]
- ACF put a comma after the last repeater field value [closed]
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Foreach loop inside an array_merge
- Form search query – displaying ACF “Post Object” field as results
- InnerBlocks with allowedBlocks not working with acf_register_block
- Accessing values from ACF sub field (flexible content area) in PHP
- Creating an image from a custom field
- Loop over Array and get the distinct ids
- Can I set up a hover animation in CSS depending on a PHP conditional?
- How to access or parse key/values that have “string”
- If Array Values Match Another Array’s Values, Then
- Get ACF options field in PHP acting as CSS
- Remove empty terms from array, sort alphabetically, update back to repeating field
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Only show first image in foreach loop
- ACF & Bootstrap Gallery Shows Blank Slides [closed]
- ACF Repeater Pagination stopped working since upgrade to php7.2
- How can I count ACF sub_field with a certain value
- How can I get all values from my array in a loop in php? [closed]
- Getting posts to exclude from array
- Get all posts as an array ID => Name
- what is the method to echo class attribute inside the i tag? [closed]
- I’m unable to call img path using single quotes in an array?
- Filter by field with array value in ACF on WP REST API
- extract serialized array to use for wp-query
- Refactoring long if/else php chains
- get users search not working with array
- Getting taxonomy category Image from ACF [closed]
- Comapare get_user_meta value
- How can get all users by current user meta?
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- Get the id of all images in a post
- Output category list inside array
- how to make an array of post id’s in is_single
- How can I split my query result in 2 arrays?
- Multidimensional Array
- Separate array output into a
- array_rand not working correctly?
- Show get_sub_field value if it exists [closed]
- Update post meta – Custom field does not match meta-key
- Get css class of menu item in custom menu structure
- Dynamically adding filters
- Advanced Custom Fields [closed]
- Order a WP_Query by meta value where the value is an array
- ACF Unexpected T_CONSTANT_ENCAPSED_STRING [closed]
- Only load certain artists on this page
- add the value of a variable returned in a while loop [closed]
- ACF checkbox array is returning numbers, not labels [closed]
- Including Custom fields within the_content
- Get All In One SEO Pack to use custom field instead of Content
- Remove Post if Advanced Custom Field is checked to fix paging
- Update value of a associative array with update_post_meta
- How to make sure relative URL works when site is not on root domain?
- Get URI from PodPress using PHP
- How To Pass Array To get_the_category_by_ID() and Get An Array Back?
- using images in next/previous_post_link [closed]
- Finding and removing duplicates within WP Arrays
- Using multiple variables to assign categories to an array
- Custom functions for string data calculations
- Add custom fields from different posts
- Update user repeater meta (ACF) with another user meta field value
- Display Post Title From Select Choice Loop in Advanced Custom Fields (ACF) – WordPress
- Repeat a function with 24hrs gap for n number of days
- MySQL Query Returns Array () In Shortcode
- Add class to all img if they have a certain ACF field
- Foreach loop is unexpectedly outputting an extra empty a tag
- Delete images from media library when user deletes an image from ACF Gallery
- How to store checkbox data for individual users?
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- Problems updating nested ACF field groups
- Convert a column of a table containing an Array as response in HTML
- Display acf taxonomy attachment
- Nested Queries of decreasing specificity