Home Forums Front-end Issues Display Field Group like a category page


Display Field Group like a category page

  • I created a field group called Brochures with 6 types. The field group is set as a Post Type. The individual “brochures” posts render as intended. What I would like is to display all of them on one page like a category page.
    My initial attempt was to create an array like so
    ‘post_type’ => ‘brochure’,
    ‘showposts’ => 10
    ) );
    The get_field or get_field_object doesn’t seem to pull anything in.
    <?php get_field_object(‘file_letter’, $post_id); ?>

    I would greatly appreciate assistance on this. I hope I was able to describe what I am trying to do.

  • 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()) {
          <h1><?php the_title(); ?></h1>
          <?php the_content(); ?>
            <h2>A Custom Field</h2>
            <?php the_field('file_letter'); ?>
      } // end while have posts
    } // end if have posts

    for more examples of querying posts and showing custom fields take a look at

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.