• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Display ACF on a page

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Display ACF on a page

This topic is: not resolved

Tagged: ACF, custom page, repeater

  • This topic has 2 replies, 2 voices, and was last updated 10 years, 9 months ago by pathetix.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • October 18, 2014 at 12:40 am #128229
    pathetix
    Member

    I'm trying to display my ACF repeater fields on a page in a way that the page content will be displayed first followed by the ACF fields that I have set.

    With the codes I currently have, the repeater fields are positioned outside of article .entry.

    Is there a way to put the repeater fields inside the article?

    
    <?php get_header(); ?>
        <?php do_action( 'genesis_before_content_sidebar_wrap' ); ?>
        <div id="content-sidebar-wrap">
            <?php do_action( 'genesis_before_content' ); ?>
            <main class="content">
                <?php do_action( 'genesis_before_loop' ); ?>
                <?php do_action( 'genesis_loop' ); ?>
                <?php
                $animal = get_post_meta( get_the_ID(), 'animal', true );
                if( $animal ) {
                    for( $i = 0; $i < $animal; $i++ ) {
                        $animal_name = esc_html( get_post_meta( get_the_ID(), 'animal_' . $i . '_animal_name', true ) );
                        $animal_image = (int) get_post_meta( get_the_ID(), 'animal_' . $i . '_animal_image', true );
                        // Thumbnail field returns image ID, so grab image. If none provided, use default image
                        $animal_image = $animal_image ? wp_get_attachment_image( $animal_image, 'be_video' ) : '<img src="' . get_stylesheet_directory_uri() . '/images/default-animal.png" />';
                        // Displayed in two columns, so using column classes
                        $class = 0 == $i || 0 == $i % 2 ? 'one-half first' : 'one-half';
                        // Build the animal box
                        echo '<div class="' . $class . '"><a href="lala">' . $animal_image . '</a>' . $animal_name . '</div>';
                    }
                }
                ?>
                <?php do_action( 'genesis_after_loop' ); ?>
            </div><!-- end #content -->
            <?php do_action( 'genesis_after_content' ); ?>
        </div><!-- end #content-sidebar-wrap -->
        <?php do_action( 'genesis_after_content_sidebar_wrap' ); ?>
    <?php get_footer(); ?>
    
    October 18, 2014 at 2:31 am #128234
    Brad Dalton
    Participant

    You could try the genesis_entry_footer hook or the_content filter


    Tutorials for StudioPress Themes.

    October 18, 2014 at 10:37 pm #128294
    pathetix
    Member

    Hm, I'm not really proficient in Genesis hooks.
    I'll read those articles first and try.

    Thanks!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble