<?php $chap = 0;?>
<?php $page = 0;?>
/*
Put the counters outside the loops
put variables inside the loop
*/
<?php while(has_sub_field("page_content")): ?>
<?php if(get_row_layout() == "image_slide"): // layout: Content ?>
<li><a href="#item<?php echo $chap++; ?>"><?php the_sub_field("title"); ?></a></li>
<?php elseif(get_row_layout() == "file"): // layout: File ?>
<?php endif; ?>
<?php endwhile; ?>
<?php while(has_sub_field("page_content")): ?>
<?php if(get_row_layout() == "image_slide"): // layout: Content ?>
<div class="bb-item" id="item<?php echo $page++; ?>">
<div class="content">
<div class="scroller">
<p><img src="<?php the_sub_field("image"); ?>"/></p>
</div>
</div>
</div>
<?php elseif(get_row_layout() == "file"): // layout: File ?>
<?php endif; ?>
<?php endwhile; ?>
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.