• 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

Loop Post Custom Genesis

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 › Loop Post Custom Genesis

This topic is: not resolved

Tagged: custom loop

  • This topic has 1 reply, 2 voices, and was last updated 8 years, 3 months ago by Brad Dalton.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • January 23, 2017 at 1:26 am #199831
    James84
    Member

    I created a custom loop post in genesis, but it does not work properly. When I click on read more, I open the article but always edo the three items and not the individual article.
    I can not goats where the error. Could you kindly help me, this is the code in the function.

    remove_action('genesis_loop', 'genesis_do_loop');
    add_action('genesis_loop', 'tmp_custom_loop');

    function tmp_custom_loop() {
    global $post;
    // arguments, adjust as needed
    $args = array(
    'post_type' => 'post',
    'posts_per_page' => 5,
    'post_status' => 'publish',
    'paged' => get_query_var( 'paged' )
    );
    global $wp_query;
    $wp_query = new WP_Query( $args );

    if ( have_posts() ) :

    while ( have_posts() ) : the_post();
    echo '<div class="a_image bg_grey">' . genesis_get_image() . '</div>';
    printf( '<article %s>', genesis_attr( 'entry' ) );
    echo '<div class="a_container">';
    echo '<div class="a_info f_sabbia">';?>
    <div class="table">
    <div class="a_date"><?php the_date('d/m/Y', '<h2>', '</h2>');?></div>
    <div class="a_author"> <?php the_author() ?></div>
    <div class="a_category"><?php the_category() ?> </div>
    </div>
    <?php
    echo '</div>';
    echo '<div class="a_content">';
    echo '<div class="a_title"><h1>' . get_the_title() . '</h1></div>'; ?>
    <div class="a_excerpt"> <?php the_excerpt() ?> </div>
    " class="a_link">Approfondisci
    <?php
    //echo '<div class="a_excerpt">' . the_excerpt() . '</div>';
    //printf( '%sApprofondisci', get_permalink(), genesis_a11y_more_link( esc_html( $_genesis_loop_args['more'] ) ) );
    echo '</div>';
    echo '</div>';
    echo '</article>';
    endwhile;

    do_action( 'genesis_after_endwhile' );
    endif;
    wp_reset_query();
    }

    January 23, 2017 at 7:18 pm #199906
    Brad Dalton
    Participant

    Please paste the code in a Github gist and link to it from here so its easy to test.


    Tutorials for StudioPress Themes.

  • 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