I’m setting how many news articles should be rendered on the homepage.
<?php foreach (page('news')->children()->sortBy('date', 'desc')->limit(3) as $article): ?>
So, I need a little help here, how do i insert the number into the limit()
within the foreach
loop?
Like this somehow?
<?php foreach (page('news')->children()->sortBy('date', 'desc')->limit($articleNum) as $article): ?>
I’m such a noob.