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)
- Display all values of custom a field created with ACF on a page
- Sorting list of sites from multisite network using wp_get_sites
- How to store the_title() into a variable to reutrn the value, not just echo it
- If Custom Field is empty don’t display div
- How to update single value in multi dimensional Post Meta?
- The values of custom fields are not available functions.php
- Generate an array of parent/child page IDs, based on parent page name
- How do I output a database option that is an array into a get_posts array?
- How do I dynamically generate args for wp_query?
- ACF: Only get first row of a Repeater Field
- Parsing php string in jquery [closed]
- Working with query_posts ( arrays and query strings)
- Trouble With Conditional Logic in PHP
- How to properly loop through these external URLs to get them into the sitemap using this hook
- Using Advanced Custom Fields to create a per page slider
- Call global variable array() in woocommerce child/template
- Display PHP within HTML values
- Populate dropdown with Child Pages based on Parent Page chosen
- Unable to write multiple values back to ACF user field – PHP
- PHP Array Returning [object Object]. Tried existing answers results with no luck
- Update grandchild repeater field with value per row
- Sort by page information by Ascending Numbers
- Alter required message using comment form api
- wp_force_remove_style’ not found
- Download PDF after CF7 form submission
- How to use if statement in an array? [closed]
- How to array only one key from another array
- 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?
- 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?
- HTML Special Characters in URL string [closed]
- Foreach loop inside an array_merge
- 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
- WordPress loop by meta key that is an array? and how loop multiple arrays
- ACF & Bootstrap Gallery Shows Blank Slides [closed]
- Getting posts to exclude from array
- Refactoring long if/else php chains
- Getting taxonomy category Image from ACF [closed]
- Comapare get_user_meta value
- How can get all users by current user meta?
- how to make an array of post id’s in is_single
- array_rand not working correctly?
- Update post meta – Custom field does not match meta-key
- Get css class of menu item in custom menu structure
- Dynamically adding filters
- Display Post Title From Select Choice Loop in Advanced Custom Fields (ACF) – WordPress
- Add class to all img if they have a certain ACF field
- Display acf taxonomy attachment
- Nested Queries of decreasing specificity
- Sending simple variable on single page to WP JSON
- Order users by random not working?
- Bootstrap 4 Carosuel with ACF Repeater field
- How to display acf field values from home page on all pages?
- Set ACF on order during checkout
- How can I show how much water got saved on this order (making use of the number of items bought) on a thank-you-page?
- Get field value and use as variable in php
- Show the subcategory name based on current product
- get_template_part() not working with Advanced Custom Fields plugin
- List all ACF field values across every post on one page
- Javascript Tab Gallery with Advanced Custom Fields
- How to filter specific element of an array in wordpress/php?
- PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)
- How can I copy an ACF field to AIOSEO field? [closed]
- Remove item from post_meta array via AJAX
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- WooCommerce Custom Tab with ACF Repeater Field
- PHP array to jQuery array ” Uncaught SyntaxError: Unexpected token < "
- PHP for loop not working as intended
- Reformat data within a nested array
- How to find the function which is outputting Array
- Create Customization Controls from Array
- Sort by multiple options in custom field
- If or/and statement advanced custom fields [closed]
- Top menu disapears in Category Pages when filtering using ACF
- ACF loop and php formatting
- !in_array doesnt recognize category
- Custom field within shortcode
- Showing all post from all post type in admin backstage
- How to set if meta_value is lower < than other meta_value in a get_posts array?
- ACF allow zero as a value
- Populate checkboxes from array
- Advanced custom fields Repeater conditional statement not working [closed]
- PHP Use Declared array Variable inside already Declared Array
- Why is my array_diff usage breaking things?
- Grabbing value of input field inside of array
- save array of objects with update_option
- How can I get values from a custom post type depending on where I click on my SVG map?
- Creating posts with php-script + csv
- PHP – Converting elements to actual values