• 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

Page template with custom loop not displaying WordPress GUI content

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 › Page template with custom loop not displaying WordPress GUI content

This topic is: not resolved

Tagged: advanced custom fields, custom loop, page template

  • This topic has 1 reply, 2 voices, and was last updated 11 years, 3 months ago by Susan.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 20, 2013 at 4:11 pm #74581
    sugarfiend06
    Member

    New to PHP, WordPress, and Genesis, so it's really likely I might be missing something super-basic here. I'm using the Genesis framework only, making my own child theme. (Yeah, I know I'm overly ambitious/insane.)

    I want to be able to display content from the WordPress GUI (not a custom field) before the loop on a page template that also displays custom fields from the Advanced Custom Fields plugin. Basically, I want the page content to be intro text. I've been trying both the_content(); and get_the_content(); functions but it doesn't seem that either one is working.

    I know I've gotten the HTML and PHP syntax right, since the tags do show up and the title appears correctly - there's just nothing between the <p> tags. I'm not sure what else to try, since everything I've Googled says that either get_the_content(); or the_content(); should work.

    This is the entire page template:

    <?php
     
    /**
     * Template Name: Programs overview
     * Description: Used as a page template to show page contents, followed by a loop through a CPT archive  
     */
    
    remove_action( 'genesis_post_content', 'genesis_do_post_content' );
    remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
     
    remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
    add_action ( 'genesis_loop', 'cm_programs_custom_loop' ); // Add custom loop
    
    function cm_programs_custom_loop() { ?>
        <h1><?php echo get_the_title(); ?></h1>
        <div class="overview">
            <p><?php echo get_the_content(); ?></p>
        </div>
        <?
    
        $args = array(
            'post_type' => 'programs', // enter your custom post type
            'order' => 'ASC',
            'posts_per_page'=> '5',  // overrides posts per page in theme settings
        );
        $loop = new WP_Query( $args );
        if( $loop->have_posts() ):
                    
            while( $loop->have_posts() ): $loop->the_post(); global $post;
     
            echo '<div class="programlist">';
                echo '<h3>'.get_the_title ().'</h3>';
                echo '<p>';
                the_field( 'short_descriptive_headline' );
                echo '</p>';  
            echo '</div>';
            
            endwhile;
            
        endif;
        
    
    }
    
        
    /** Remove Post Info */
    remove_action('genesis_before_post_content','genesis_post_info');
    remove_action('genesis_after_post_content','genesis_post_meta');
     
    genesis();
    http://caremaestro.anitacheng.com/programsoverview/
    February 12, 2014 at 7:34 pm #90072
    Susan
    Moderator

    Since it's been a while since you posted your question, I hope you got your issue resolved.

    If not, please report back to me, and I will escalate to try to get someone to assist you.

    Thanks!

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 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