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?
- Sending the reset password link programatically
- How do I directly access a PHP file located in my themes folder?
- Only show div on homepage/blog index in wordpress/php
- Calculate percentage of post by category
- file_exists() acting weird
- Is it possible to use the featured image of a page as a css background without inlining?
- PHP syntax error when using wpdb update?
- Select dropdown not showing selected value php
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- items_wrap not working
- Can is_page() be combined with a switch control structure?
- Using shipped version of jquery
- Run a filter when a walker runs
- WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
- Can’t search posts using WP_QUERY inside AJAX Function
- How do I Add HTML to the_excerpt() & the_content() Output?
- Display fields as values in array from external SQL DB
- my posts are saved as drafts
- User’s total comment count excluding comments on their own posts
- Populate dropdown with Child Pages based on Parent Page chosen
- How can I remove a function that has been added to wordpress with add_filter?
- do search in two site and show the result in first site
- What’s the uses of wp_cache_set() or wp_cache_add()?
- How to get post’s current parent term ID?
- Adding Taxonomy Image to taxonomy loop [closed]
- get_the_title() gets printed out twice
- What does this mean in wordpress? Easy question
- How to get private property in parent class into extended class?
- Add Codepen animation as Preloader to WordPress
- Setting user nickname and displayname to shortened email
- Error Uncaught ArgumentCountError i cant find it
- Loop stopped working
- How does WordPress differentiate what scripts are loaded in wp_head() and wp_footer()?
- Need to add class to first element in a foreach loop
- Simple WordPress endpoint route doesn’t work
- How do I create a function that modifies a message in the wp-login.php file?
- HTML dropdown setting not showing last saved value in the database
- Why when I create a new post I found 2 record related to this post into the posts database table?
- Unable to Call More than One Meta Box Output
- Trying to display terms from custom taxonomy within function
- Most viewed posts in WordPress
- Displaying a List of Changes / Updates on the Website Publicly
- Dropdown category field inside repeatable metabox
- How to extend SelectControl with data from my theme
- Retrieve alt text by referencing the img src
- How to add Text before my Custom Term and hide it when empty
- Responsive loop with 3 columns inside row then 2 columns
- How To Get HTML Eelement From Another Page
- Delete post meta by serialized meta value
- Cron job -many duplicate posts
- How to get a post’s attached media (audio) ID and insert it into rtmedia shortcode
- Customizer textarea with script tag won’t work in live preview
- How to give custom roles the capability to edit one Menu instead of every Menu
- Unzip_file causing Media file upload error
- Styling a specific post after hovering over it
- WordPress file upload
- Escaping a Single Quote in str_replace for Nav Function
- widget: input the px value from user and use it as inline style in widget function
- Setting pages for posts
- Problems with plugin that fetches data from database with ajax
- why is markup routinely placed in functions in wordpress?
- Customise Author Page?
- Is there a way of displaying related posts from lowest hyrachical order (lowest child category to parent category)
- Difference between php memory limit and wp memory limit?
- How to change wp-admin and wp-login urls
- Permissions error when I use my plugin to delete comments in the front-end