Ecommerce Shopify WordPress Discussion

array not Display Same positions

post1 | Post 2 | Custom Ads <br> Custom Ads | post 3 | post4 display Ads Same positions In Wordpress Website Array is not displaying properly due to which the layout of the design is too much out See Image <?php $count = 0; $ad_positions = [3,4]; // enter the desired positions $ads = [ '<div class="dp-in swiper-slide"> <div class="listing-car-item"> <div class="listing-car-item-inner"> <img decoding="async" class="img-responsive s" src="https://www.splitarts.net/smr/wp-content/uploads/2021/03/deal.png"> <h3>looking for a deal?</h3> <p>save big on discounted cars.</p> <a class="elementor-button elementor-button-link elementor-size-sm" href="#"><span class="elementor-button-content-wrapper"><span class="elementor-button-text">SHOP DEALS</span></span></a> </div> </div> </div>', '<div class="dp-in swiper-slide"> <div class="listing-car-item"> <div class="listing-car-item-inner"> <img decoding="async" class="img-responsive s" src="https://www.splitarts.net/smr/wp-content/uploads/2021/03/trade.png"> <h3>looking for a deal?</h3> <p>save big on discounted cars.</p> <a class="elementor-button elementor-button-link elementor-size-sm" href="#"><span class="elementor-button-content-wrapper"><span class="elementor-button-text">SHOP DEALS</span></span></a> </div> </div> </div>', // and so on ]; while ( $special_query->have_posts() ) : ?> <?php if ( is_front_page() ) { $count++; if( in_array( $count, $ad_positions ) ){ $ad = array_shift( $ads ); // gets and removes the first ad from the array echo $ad ; } } ?>
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.