The code for listing posts sits directly inside the
profile.php page, which was fine up until now. However, in a moment, we'll want to be able to display posts via
foreachcode that lists out posts from
views/user/profile.php, and paste it into our new file
_posts.php. The end result of
_posts.phpshould as follows:
<?php foreach ($posts as $post): ?> <div class="post-item row"> ...