I'm trying to get further, new Image Links that are loaded to display.
Currently 5 are displayed, but we want to add a sixth & maybe 2 or 3 others in the future.
The issue we are having is when we add the sixth, it overwrites one of the existing 5.
Can anyone help with, what I suspect is the Function, to allow us to add more?
Thanks
HTML
<div class="content">
<div class="visible-xs visible-sm" style="background: #367586;color: white;width: 100%;">
<h2 style="color: white;padding: 20px;text-align: center;">Call us on <a style="text-decoration: none;color: white;" href="tel:0141999999">0131 344 4146</a></h2>
</div>
<div class="pageTitle">
<h1><?php single_cat_title(); ?></h1>
</div>
<?php
$posts = get_posts('category='.$cat);
vvwc_carouselList($posts);
?>
<div class="clearfix"></div>
PHP
function vvwc_carouselList($posts, $postId=null){
if(!empty($posts)){
echo '
<div class="nonCarousel">
<ul class="list-inline">
';
$x = 1;
foreach($posts as $post){
$active = '';
$feature = '';
if($postId == $post->ID){
$active = 'active';
$feature = 'feature';
}
if($x == 5 || $x == 1){
?>
<div class='row'>
<?php
}
echo '
<li class="col-md-3 '.$feature.'">
<div class="'.$active.' carousel-border">
<div class="carousel-item">
<a data-item="'.$post->ID.'" href="'.get_permalink($post->ID).'">
';
if(has_post_thumbnail($post->ID)){
echo get_the_post_thumbnail($post->ID);
}
echo "<div class='camperTitle'>" . strtoupper($post->post_title) . "</div>";
echo '
</a>
</div>
</div>
</li>
';
if($x == 4 || $x == count($posts)+1 ){
?>
</div>
<?php
}
$x ++;
}
echo '
</ul>
<div class="clearfix"></div>
</div>
';
}
echo '
<div class="clearfix"></div>
<script>
jQuery(document).ready(function($){
$(".carousel ul").owlCarousel({
items: 4,
pagination: false,
navigation: true,
navigationText: false,
slideSpeed: 1000,
rewindSpeed: 1000
});
});
</script>
';
}