Last active
October 19, 2017 12:54
-
-
Save MoisesTedeschi/5a2b6d5debee0db3d19dde70f41c9f1c to your computer and use it in GitHub Desktop.
Loop para depoimentos - Teste
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Slide Padrão --> | |
<div id="carousel-depoimentos" class="carousel slide" data-ride="carousel"> | |
<div class="carousel-inner"> | |
<?php if( have_rows('depoimento_rh') ): ?> | |
<?php $cont = 1; ?> | |
<?php while ( have_rows('depoimento_rh') ) : the_row(); ?> | |
<?php | |
if($cont == 1): | |
echo '<div class="item active">'; //Problema resolvido - A classe active precisava estar ativa no primeiro item do loop. | |
else: | |
echo '<div class="item">'; | |
endif; | |
?> | |
<div class="row"> | |
<div class="col-sm-8 col-xs-offset-2 col-xs-8 col-md-offset-1 col-md-10"> | |
<div class="caption"> | |
<p class="font_lora_italic"><?php the_sub_field('conteudo_rh'); ?></p> | |
<br /> | |
<h4><?php the_sub_field('autor_rh'); ?></h4> | |
<p><?php the_sub_field('cargo_rh'); ?></p> | |
</div> | |
</div> | |
</div> | |
</div> | |
<?php | |
$cont = ++$cont; | |
endwhile; | |
else: | |
echo "Não há depoimento cadastrado!"; | |
endif; | |
?> | |
</div> | |
<!-- Slide Padrão --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment