For example I want to loop through all pages in the category "nav" and display their title:
Code: Select all
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<!-- currently I'm just displaying all page titles -->
<?php foreach ($content as $page): ?>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#<?php echo $page->title(); ?>"><?php echo $page->title(); ?></a>
</li>
<?php endforeach ?>
</ul>
</div>
Code: Select all
<section id="videos" class="about-section projects-section text-center">
<div class="container">
<div class="row videos-section text-center">
<?php foreach($content as $page): ?>
<div class="col-lg-6">
<div class="bg-black text-center h-100 project">
<div class="d-flex h-100">
<div class="project-text w-100 my-auto text-center text-lg-left">
<h4 class="text-white">
<?php echo $page->title(); ?>
</h4>
<p class="mb-0 text-white-50">
<?php echo $page->content() ?>
</p>
<hr class="d-none d-lg-block mb-0 ml-0">
</div>
</div>
</div>
</div>
<?php endforeach ?>
</div>
</div>
</section>