Hi, I have set up blog posts fine to show featured and non featured but I can seem to get the Portfolio posts to do the same. I’m probably doing something stupid simple wrong but if anyone can point out where I’m going wrong that would be great.
This is the current code without my additional code (due to my dodgy code)
<?php snippet('head') ?>
<div class="container <?= $page->slug() ?>" >
<div class="module nopad">
<?php snippet('header') ?>
<main>
<header class="intro">
<h1><?php echo $page->title()->html() ?></h1>
</header>
<?php echo $page->text()->kt() ?>
<div class="portfolioslist">
<!-- FEATURED PORTFOLIO PIECES -->
<?php foreach($page->children()->visible()->flip() as $portfolio): ?>
<section>
<div class="imgcontainer">
<a href="<?php echo $portfolio->url() ?>" class="title-link">
<img src="<?= $portfolio->featuredimage()->toFile()->url() ?>" alt="<?= $portfolio->title() ?>"></a>
</div>
<div class="textcontainer">
<h2><a href="<?php echo $portfolio->url() ?>" class="title-link"><?php echo $portfolio->title()->html() ?></a></h2>
<p><?php echo $portfolio->text()->excerpt(300) ?></p>
<p class="button"><a href="<?php echo $portfolio->url() ?>" class="readmore button">Read more</a></p>
</div>
</section>
<?php endforeach ?>
<hr />
<!-- NON FEATURED PORTFOLIO PIECES -->
<?php foreach($page->children()->visible()->flip() as $portfolio): ?>
<section>
<div class="imgcontainer">
<a href="<?php echo $portfolio->url() ?>" class="title-link">
<img src="<?= $portfolio->featuredimage()->toFile()->url() ?>" alt="<?= $portfolio->title() ?>"></a>
</div>
<div class="textcontainer">
<h2><a href="<?php echo $portfolio->url() ?>" class="title-link"><?php echo $portfolio->title()->html() ?></a></h2>
<p><?php echo $portfolio->text()->excerpt(300) ?></p>
<p class="button"><a href="<?php echo $portfolio->url() ?>" class="readmore button">Read more</a></p>
</div>
</section>
<?php endforeach ?>
</div>
</main>
</div>
</div>
<?php snippet('footer') ?>