There’s some code missing from your question – the code where your slides are actually output.
The foreach
loop you’ve posted only sets the variables, and the actual output happens below the loop.
So, all you’re doing on the fourth slide is avoiding setting the variables… hence the slide is still output, but using the third slide’s variables.
Your if
checkbox logic looks ok; you just need to include the logic on the actual code that outputs the slides too.
Related Posts:
- Output 2 items within the Loop
- How to get URL of current page displayed?
- Getting only direct child pages in WordPress with get_pages
- Query multiple custom post types in single loop
- What is This esc_html_e() i wordpress php?
- How can I fetch loop of post titles via AJAX?
- Inject post (from specific category) between posts in Loop
- Knowing the total number of posts before to get into the loop
- get product attributes for current product and store it in a variable
- Build a content and excerpt grid loop with paging and options for # of posts
- Show content if parent page has children
- Current post’s author name in the author meta tag
- Displaying post per day
- Installing wp3.2.1 on IIS; getting empty sessions
- Guidance with The Loop for CMS
- Display only text to WordPress loop without loosing the text formatting
- How to loop over custom fields in a page template?
- How to add active class to custom menu using while loop and wp_list_pages
- Want to separate sections of posts. Can you restart loop?
- Conditional statement for parent, child and grandchild pages
- MySQL query performed 4 times inside loop
- Print html when custom field has value inside while loop
- Alter secondary loop to exclude posts from current page category
- Post from one loop in different containers?
- Custom Loop Pagination on WordPress
- Specific Loop For 2 Within Each
- delete an array element when its date expires
- Two posts in same div – WP loop
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- How to change post count in wordpress loop?
- How can I loop into two different DIVS without repeating the DIVs
- User Defined order on get_categories?
- Woocommerce, recognize the loop of related products
- Trying to use Ternary operators with WP Conditionals
- Store loop into array
- Looping through WP_Post Object
- WordPress loop specific thumbnail size
- get understrap pagination to work with custom query
- When is is_admin() available?
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Displaying Only Certain Tags in Loop
- Check if current page is wp-admin
- Easiest way to show total number of subpages
- Second Navigation inside header
- Custom Loop through category menu to include sub categories
- When would you use $_post instead of $post?
- Using is_page() in functions.php not working at all
- How do I display the function the_content in this loop?
- Show Custom Taxonomy Title
- conditional statement for custom taxonomy
- How to exclude specific category from the get_the_category(); array
- Way to display “Yesterday”, “Today”
- How can i display post loop in table format?
- spliting posts into two columns
- Must Use Plugin Causing Query Error
- How to get to a specific position in wp_query?
- Advanced Custom Fields: Post Object – Not returning data [closed]
- How to speed up a wordpress function with multiple loops?
- Facebook “like” open graph meta in header.php
- Custom excerpt function re-factoring
- How can I show the post thumbnail from the most recent of a certain post type, in widget?
- How to enqueue CSS and JS only on specific template?
- multiple if statements [closed]
- How to select WooCommerce products by post_meta and order them
- How can I add pagination and how can I change thumbnail size?
- How to Display a Single Post Excerpt
- have_posts() execution failure
- How does the ternary operator work in the wordpress loop post?
- $wpdb->flush(); breaks the loop
- Use object in template part
- Get first URL from post content
- How can I add multiple ‘tax_query’ arrays via a loop?
- ACF page while loop breaks footer while loop
- Using foreach loop breaks
- Cannot display or echo alt text on featured image
- Using Advanced Custom Fields to create a per page slider
- Split loop into two columns, how to favor one side over the other
- WordPress Search Results for Multiple Post Types
- how could I load a different template part by page
- Changing layout with wp_customise
- Dynamic Stylesheet loads but doesn’t finish
- Filter Select results based on selection
- Using loop pagination on single.php
- Loop with slider (slider not loading)
- How to hide all child pages with post_query?
- How to sort posts based on the value (number) of a post’s metadata?
- Show css depending on activity type in BuddyPress activity-loop [closed]
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- Iterate through posts based on array of categories
- get author_name from queried post
- Displaying Woocommerce Product Category in WordPress
- How can I add extra word in permalink when someone click download button?
- WordPress, AJAX and pre_get_posts using conditional tags
- Increase offset while looping
- Blog posts repeat
- How to add condition in wordpress loop? [closed]
- Woocommerce : Can’t get product info in loop
- How to set variable, pass it to a partial file and remove it after?
- how to refresh div on template part?
- Alert Bar section within WP loop is displaying even though there are no posts