I have a problem with this carousel, that is the page is loaded but it gives me error only on mobile
The code is this:
<section class="d-block d-md-none" style="padding-top:30px;margin-bottom:0px;">
<div style="text-align:center; color: black; font-family: 'Roboto'; font-size: 22px; font-weight:700; text-transform: uppercase;">
<?php echo $pages->find('eventi')->sottotitolo();?><span style="font-weight:200;"> <?php echo $pages->find('eventi')->brevedescrizione();?></span></div>
<div class="container">
<div class="row" style="padding-top:10px; padding-bottom:30px;">
<div class="owl-carousel owl-theme stage-margin" data-plugin-options="{'items': 4, 'margin': 10, 'autoplay': true, 'loop': true, 'nav': true, 'dots': false, 'stagePadding': 40, 'autoplayTimeout': 3000}">
<?php $eventi = $pages->find('eventi')->children()->map(function($page) {
$page->timestampfield = strtotime($page->datestart());
return $page;
})->sortBy('timestampfield', 'desc');
$eventi = $eventi->map(function($page) {
$page->timestampfield = strtotime($page->pubblica());
return $page;
})->filterBy('timestampfield','<=',time());
$eventi = $eventi->limit(40);
?>
<?php foreach($eventi as $evento):?>
<div style="padding-top:20px; padding-left:10px; padding-right:10px;">
<a href="<?php echo $evento->url();?>" style="text-decoration:none;">
<span class="thumb-info thumb-info-no-overlay ">
<span class="thumb-info-wrapper">
<img src="
<?php echo thumb($evento->image(), array('width' => 800, 'height' => 800, 'crop' => true))->url();?>" class="img-fluid">
</span></span>
<div style="padding-top:15px; font-family: 'Roboto'; min-height:40px; font-size: 20px; color: black; font-weight: 700; text-transform: uppercase; line-height:20px !important;">
<?php echo $evento->title();?></div></a>
<div class="post-date ml-0">
<?php
setlocale(LC_TIME, 'it_IT');
$datainizio = $evento->datestart();
$datainizio = strtotime($datainizio);
$giornoinizio = utf8_encode( strftime("%d ", $datainizio) );
$meseinizio = utf8_encode( strftime("%b", $datainizio) );?>
<span class="day"><?php echo $giornoinizio?></span>
<span class="month"><?php echo $meseinizio?></span>
</div><div style="padding-top: 10px; font-family: 'Roboto'; min-height:55px; font-size: 16px; color: black; font-weight: 400; line-height:17px !important;"><?= excerpt($evento->text(),80) ?></div>
<hr class="gradient">
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</section>
<section class="d-none d-md-block" style="padding-top:30px;margin-bottom:0px;">
<div style="text-align:center; color: black; font-family: 'Roboto'; font-size: 22px; font-weight:700; text-transform: uppercase;">
<?php echo $pages->find('news')->sottotitolo();?><span style="font-weight:200;"> <?php echo $pages->find('news')->brevedescrizione();?></span></div>
<div class="container">
<div class="row" style="padding-top:10px; padding-bottom:30px;">
<?php if ($pages->find('news')->children()->count() >= 1):?>
<div class="owl-carousel owl-theme stage-margin" data-plugin-options="{'items': 4, 'margin': 10, 'autoplay': true,'loop': true, 'nav': true, 'dots': false, 'stagePadding': 40,'autoplayTimeout': 3000}">
<?php $eventi = $pages->find('news')->children()->map(function($page) {
$page->timestampfield = strtotime($page->datestart());
return $page;
})->sortBy('timestampfield', 'desc');
$eventi = $eventi->map(function($page) {
$page->timestampfield = strtotime($page->pubblica());
return $page;
})->filterBy('timestampfield','<=',time());
$eventi = $eventi->limit(40);
?>
<?php foreach($eventi as $evento):?>
<div style="padding-top:20px; padding-left:10px; padding-right:10px;">
<a href="<?php echo $evento->url();?>" style="text-decoration:none;">
<span class="thumb-info thumb-info-no-overlay ">
<span class="thumb-info-wrapper">
<img src="
<?php echo thumb($evento->image(), array('width' => 800, 'height' => 800, 'crop' => true))->url();?>" class="img-fluid">
</span></span>
<div style="padding-top:15px; font-family: 'Roboto'; min-height:40px; font-size: 16px; color: black; font-weight: 700; text-transform: uppercase; line-height:16px !important;">
<?php echo $evento->title();?></div></a>
<div class="post-date ml-0">
<?php
setlocale(LC_TIME, 'it_IT');
$datainizio = $evento->datestart();
$datainizio = strtotime($datainizio);
$giornoinizio = utf8_encode( strftime("%d ", $datainizio) );
$meseinizio = utf8_encode( strftime("%b", $datainizio) );?>
<span class="day"><?php echo $giornoinizio?></span>
<span class="month"><?php echo $meseinizio?></span>
</div><div style="padding-top: 10px; font-family: 'Roboto'; min-height:55px; font-size: 12px; color: black; font-weight: 400; line-height:13px !important;"><?= excerpt($evento->text(),80) ?></div>
<hr class="gradient">
</div>
<?php endforeach; ?>
</div><?php else: ?><div class="col-md-12" style="padding-top:80px; padding-bottom:80px; text-align:center; font-weight: 200; color: #272f65; font-family: 'Roboto'; font-size: 22px;">COMING SOON </div><?php endif; ?>
</div>
</div>
</section>
<section class="d-blcok d-md-none" style="padding-top:30px;margin-bottom:0px;">
<div style="text-align:center; color: black; font-family: 'Roboto'; font-size: 22px; font-weight:700; text-transform: uppercase;">
<?php echo $pages->find('news')->sottotitolo();?><span style="font-weight:200;"> <?php echo $pages->find('news')->brevedescrizione();?></span></div>
<div class="container">
<div class="row" style="padding-top:10px; padding-bottom:30px;">
<?php if ($pages->find('news')->children()->count() >= 1):?>
<div class="owl-carousel owl-theme stage-margin" data-plugin-options="{'items': 4, 'margin': 10, 'autoplay': true,'loop': true, 'nav': true, 'dots': false, 'stagePadding': 40,'autoplayTimeout': 3000} ">
<?php $eventi = $pages->find('news')->children()->map(function($page) {
$page->timestampfield = strtotime($page->datestart());
return $page;
})->sortBy('timestampfield', 'desc');
$eventi = $eventi->map(function($page) {
$page->timestampfield = strtotime($page->pubblica());
return $page;
})->filterBy('timestampfield','<=',time());
$eventi = $eventi->limit(40);
?>
<?php foreach($eventi as $evento):?>
<div style="padding-top:20px; padding-left:10px; padding-right:10px;">
<a href="<?php echo $evento->url();?>" style="text-decoration:none;">
<span class="thumb-info thumb-info-no-overlay ">
<span class="thumb-info-wrapper">
<img src="
<?php echo thumb($evento->image(), array('width' => 800, 'height' => 800, 'crop' => true))->url();?>" class="img-fluid">
</span></span>
<div style="padding-top:15px; font-family: 'Roboto'; min-height:40px; font-size: 20px; color: black; font-weight: 700; text-transform: uppercase; line-height:20px !important;">
<?php echo $evento->title();?></div></a>
<div class="post-date ml-0">
<?php
setlocale(LC_TIME, 'it_IT');
$datainizio = $evento->datestart();
$datainizio = strtotime($datainizio);
$giornoinizio = utf8_encode( strftime("%d ", $datainizio) );
$meseinizio = utf8_encode( strftime("%b", $datainizio) );?>
<span class="day"><?php echo $giornoinizio?></span>
<span class="month"><?php echo $meseinizio?></span>
</div><div style="padding-top: 10px; font-family: 'Roboto'; min-height:55px; font-size: 16px; color: black; font-weight: 400; line-height:17px !important;"><?= excerpt($evento->text(),80) ?></div>
<hr class="gradient">
</div>
<?php endforeach; ?>
</div><?php else: ?><div class="col-md-12" style="padding-top:80px; padding-bottom:80px; text-align:center; font-weight: 200; color: #272f65; font-family: 'Roboto'; font-size: 22px;">COMING SOON </div><?php endif; ?>
</div>
</div>
</section>