Home › Forums › General Issues › Loop through post content from another post › Reply To: Loop through post content from another post
Alright, well I’m running roots / sage which shouldn’t make much difference.
I have a template for the “Project” posts which looks like this:
{{--
Template Name: Projekt
--}}
@extends('layouts.app')
@section('content')
@while(have_posts()) @php the_post() @endphp
@include('partials.content-projekt')
@endwhile
@endsection
And then I have content-single-projekt page which takes care of the flexible content and it looks like this:
@include('partials/section-hero')
@include('partials/section-intro')
<?php if( have_rows('content') ): ?>
<?php while( have_rows('content') ): the_row(); ?>
<?php if( get_row_layout() == 'projectfacts' ): ?>
<h1>stuff here</h1>
<?php elseif( get_row_layout() == 'apartmentlayout' ): ?>
@include('partials/section-apartment')
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
And lastly my section-apartment looks like the example up top.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.