solution By m_hutley
<div class="<?php echo ($i == $total && $total % 2 !== 0 )?'col-md-12':'col-md-6'; ?>" id="<?php echo $i; ?>">
<h1><?php echo "contain"; ?></h1>
</div>
Related Posts:
- custom shortcode will not display the wrapped content
- Multiple WordPress Menus that will only display all pages
- WordPress Multiple Navigation bars
- Using Select HTML in Bootstrap Popovers
- Add class to group inner container
- WordPress style.css not updating, only after theme reload
- My website is not showing Footer section
- Bootstrap Carousel HTML structure and funny output [closed]
- Handling repeater data
- Posts are not looping through correctly
- Get the featured image url of clicked post
- Why in this WordPress theme I can’t see the Main Menu?
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- WordPress navigation wont appear with wp_head
- Bootstrap 4 Carosuel with ACF Repeater field
- How to Create Carousel Indicators in PHP Loop using wp_get_attachment_url function?
- Split post or page content in two or more columns
- Gutenberg blocks shortcodes compatibility
- How to bind each “the_content” elements to a custom variables
- custom post type not showed with bootstrap 4 modal and template part
- Posts in two different columns Bootstrap
- PHP code printed into CSS classes
- From php web to wordpress conversion, href changes only in URL
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- making a search.php query
- Use PHP code in Menu Admin Section
- Problems with the WordPress loop [closed]
- Custom Thumbnails [closed]
- Retrieving specific images from Media Library
- add class to background image
- add bootstrap modal after login in wordpress
- How to display thumbnail if post is assigned one otherwise not
- Display WP posts in 3 responsive columns
- How to echo a different field if another field is empty?
- What do ++ and *+ mean?
- How to fix the admin menu margin-top bug in WordPress 5.5?
- Cleaning up WordPress to improve performance?
- How to add date range in woocommerce with code
- How can I modify the permalink via a filter?
- How can merge two arrays values in one array and save in database
- Network installation giving errors when viewing or adding a user
- Create a post variable processing page
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- List all categories but exclude current post category on single post page
- How Do I Add User Custom Field to REST API Response?
- Bare minimum to include in PHP file to use WP functions? [duplicate]
- Woocommerce, recognize the loop of related products
- Should I store my Facebook access tokens?
- How to return output of the new wp gallery block for automatically Link images To Media file
- Can an array be used as a meta_query value?
- WordPress different language footer text
- How do I target the child theme with get_bloginfo();?
- Can I use HTTP POSTs? Is there a better alternative?
- Will simple function names in a class structure conflict with other plugins?
- Image as Sales Badge
- Getting a specific post values to another div or modal
- WP grandchild categories in nested ul li
- Modify HTML structure of fields in woocommerce checkout form
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- How to improve my WordPress filter to include empty custom fields
- Update results, Before deleting the related category [closed]
- Add / Update Custom Fields After Select Pictures in Media Window
- Accessing WPDB Multidimensional JSON Array w/ Javascript
- Fatal error: Call to a member function query() on a non-object
- Which function crops images in wordpress?
- Remove dash from blog title wordpress
- Include text in echoed hyperlink
- set post limit at load more ajax wordpress
- Why my loop isn’t working? [closed]
- How to use AJAX to call php page with parameter
- WordPress meta_query >= &
- Change header on pages displaying taxonomy items
- Must filter functions receive all arguments passed to them?
- Prevent Company Name From Translating
- Displaying Slider in Front Page (home) using Customizr Theme
- Usage of var keyword in the core
- Ajax URLs without #!, how to prevent falling into single.php on load or reload?
- PHP displaying wrong custom taxonomy images
- Slow site initial load time
- PHP session not staying alive. headers already sent
- Set a cookie inside the 404.php theme page
- Printing OEmbed URL based on Post selected w/o page refresh
- How to use something like meta_query but for fields?
- Local WordPress from Git repo, where to set document root?
- Sort WooCommerce data with WP-CRON?
- Array sorting assistance
- Apply filters when loading post via ajax
- Shortcode At top of Page – PHP 5.5 vs 5.4 – ob_start();
- Page downloads as file in Chrome
- Redirect users not logged in to the standard login page (and back) from some posts and pages
- Gravity Forms – Prevent Multiple Form Entries Same User ID with Same Field Value
- Change background image based on tags
- How keep woocommerce users separeted in multisite install and keep admins on network
- How to show only part of product name in category page – WordPress with woocomerce
- How to crop featured image in different sizes?
- How to find out the URL of enabled theme(s)?
- How to extract URLs from wordpress taxonomies
- Warning: Illegal string offset ‘post’ and ‘page’
- Customize Notification Email Sent to New User When Manually Created by Site Administrator
- Woocommerce product variations getting created without attribute values selected