Home › Forums › General Issues › WordPress template page content not showing › Reply To: WordPress template page content not showing
I’m afraid I don’t understand your current setup, so I’ll just assume that the ‘menu_sections’ repeater is assigned to a page with ID of ‘3053’. In that case, I believe you should be able to do it like this in your index.php:
<div id="two" class="section">
<?php $page_id = 3053; ?>
<?php if ( have_rows('menu_sections', $page_id) ):
while ( have_rows('menu_sections', $page_id) ): the_row(); ?>
<h2><?php the_sub_field('section_title'); ?></h2>
<?php if ( have_rows('section_items') ): ?>
<table>
<thead>
<tr>
<td>Name</td>
<td>Description</td>
<td>Price</td>
</tr>
</thead>
<?php while ( have_rows('section_items') ): the_row(); ?>
<tr>
<td><?php the_sub_field('dish_name'); ?></td>
<td><?php the_sub_field('dish_description'); ?></td>
<td>€<?php the_sub_field('dish_price'); ?></td>
</tr>
<?php endwhile; ?>
</table>
<?php endif; ?>
<?php endwhile;
endif; ?>
</div>
I hope this helps 🙂
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.