hey tex0gen,
It didn’t work at the beginning because of the endwhile almost at the end. Then I saw that you probably had forgotten to remove that piece of code. Without it, it works.
THANKS SO MUCH!!!
It is not perfect though because for some reason it adds some characters. I’ve check the code and I don’t see the error.
Let me say that these characters already appeared in my code first.
here a screen shot
https://postimg.org/image/lho6gwawn/
Also I mentioned in my first message that I have a thumbcarousel so the user/visitor can choose what slide select. If you don’t mind to take a look. Don’t waste your time if it will take you too much, but if you see a fast answer please help me. Otherwise I’m going to keep working on it these next days (or years, hehe)
<div class="tab-content">
<div id="marmol" class="tab-pane fade in active">
<div class="row">
<div class="col-sm-6">
<div id="carousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner big-image">
<?php
$args = array(
'post_type' => 'materiales',
'orderby' => 'post_id',
'order' => 'ASC'
);
$posts = get_posts($args);
// If posts has data, continue to do the slides...
if ($posts) {
$i = 0;
// for each of the items in posts do the following..
foreach ($posts as $post) {
setup_postdata($post);
$active = ($i == 0) ? 'active' : '' ;
?>
<div class="item <?php echo $active; ?>">
<img src="<?php the_post_thumbnail('large'); ?>">
<div class="leyenda">
<p><?php the_title(); ?></p>
</div>
</div>
<?php
$i++;
wp_reset_postdata();
}
}
?>
</div><!-- carousel-inner big-image -->
</div><!-- carousel -->
<div class="clearfix">
<div id="thumbcarousel" class="carousel slide" data-interval="false">
<div class="carousel-inner">
<div class="item active">
<div data-target="#carousel" data-slide-to="0" class="thumb"><img src="assets/images/materiales/marmol/arabescato.jpg">
</div>
<div data-target="#carousel" data-slide-to="1" class="thumb"><img src="assets/images/materiales/marmol/cremamarfil.jpg"></div>
<div data-target="#carousel" data-slide-to="2" class="thumb"><img src="assets/images/materiales/marmol/cremamarfilclasico.jpg"></div>
<div data-target="#carousel" data-slide-to="3" class="thumb"><img src="assets/images/materiales/marmol/daino.jpg"></div>
</div><!-- /item -->
<div class="item">
<div data-target="#carousel" data-slide-to="4" class="thumb"><img src="assets/images/materiales/marmol/emperadorclaro.jpg"></div>
<div data-target="#carousel" data-slide-to="5" class="thumb"><img src="assets/images/materiales/marmol/marronemperador.jpg"></div>
<div data-target="#carousel" data-slide-to="6" class="thumb"><img src="assets/images/materiales/marmol/negromarquina.jpg"></div>
<div data-target="#carousel" data-slide-to="7" class="thumb"><img src="assets/images/materiales/marmol/rojoalicante.jpg"></div>
</div><!-- /item -->
<div class="item">
<div data-target="#carousel" data-slide-to="8" class="thumb"><img src="assets/images/materiales/marmol/travertinoamarillo.jpg"></div>
<div data-target="#carousel" data-slide-to="9" class="thumb"><img src="assets/images/materiales/marmol/travertinorojo.jpg"></div>
</div><!-- /item -->
</div><!-- /carousel-inner -->
<a class="left carousel-control" href="#thumbcarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#thumbcarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div> <!-- /thumbcarousel -->
</div><!-- /clearfix -->
</div> <!-- /col-sm-6 -->
<div class="col-sm-6">
<p>some text</p>
</div> <!-- /col-sm-6 -->
</div> <!-- /row -->
</div><!-- marmol -->
</div><!-- tab-content -->
I understand that we can simplify the thumbcarousel to just one piece of code instead of having one snippet for each post. I’ve given a look but i don’t find the answers