Home › Forums › Front-end Issues › Display Field Group like a category page › Reply To: Display Field Group like a category page
Not really enough information to really know what the problem is.
This is a basic query and loop, hopefully it helps you out. You’ll notice that the loop looks just like “The Loop” used for showing pages/posts/anything in WP.
$args = array(
'post_type' => 'brochure',
'posts_per_page' => 10
);
$brochure_query = new WP_Query($args);
if ($brochure_query->have_posts()) {
while ($brochure_query->have_posts()) {
$brochure_query->the_post();
?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<div>
<h2>A Custom Field</h2>
<?php the_field('file_letter'); ?>
</div>
<?php
} // end while have posts
wp_reset_postdata();
} // end if have posts
for more examples of querying posts and showing custom fields take a look at https://www.advancedcustomfields.com/resources/query-posts-custom-fields/
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.