Only Showing One Post on Front Page

Community Forums Forums Design Tips and Tricks Only Showing One Post on Front Page

This topic is: not resolved

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  braddalton 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #106201

    bsw001
    Member
    Post count: 2

    Hello,

    I’m using a custom Genesis theme and have a question about posts appearing on the front page on my site (letsgocu.com).

    Currently, only the summary for the latest post appears on the front page. All posts do appear in the blog, however.

    My Reading Settings are set to show Your Latest Posts and Blog Pages Show at Most is set to 10 posts.

    Can anyone please let me know how to set it so a set number of blog post summaries (five would be ideal) show on the front page at any time?

    Thanks!
    Brian

    http://www.letsgocu.com
    #106204

    braddalton
    Participant
    Post count: 10253

    Depends on the code in your front-page.php or home.php file and the WordPress Reading settings and the Genesis > Theme Settings.

    Otherwise you could try this code in your functions file:
    [php]
    function set_post_limit_home($query) {
    if ($query->is_home() AND $query->is_main_query()) {
    $query->set( ‘posts_per_page’, 5 );
    }
    }
    add_action(‘pre_get_posts’, ‘set_post_limit_home’);
    [/php]


    #106206

    bsw001
    Member
    Post count: 2

    Thanks, Brad. Here is the front-page.php. Is there anything I should be looking for?

    <?php
    
    /**
    
     * This file adds the Home Page to the Magazine Pro Child Theme.
    
     *
    
     * @author StudioPress
    
     * @package Magazine Pro
    
     * @subpackage Customizations
    
     */
    
    add_action( 'genesis_meta', 'magazine_home_genesis_meta' );
    
    /**
    
     * Add widget support for homepage. If no widgets active, display the default loop.
    
     *
    
     */
    
    function magazine_home_genesis_meta() {
    
    	if ( is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-bottom' ) ) {
    
    		// Force content-sidebar layout setting
    
    		add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
    
    		// Add magazine-home body class
    
    		add_filter( 'body_class', 'magazine_body_class' );
    
    		// Remove the default Genesis loop
    
    		remove_action( 'genesis_loop', 'genesis_do_loop' );
    
    		// Add homepage widgets
    
    		add_action( 'genesis_loop', 'magazine_homepage_widgets' );
    
    	}
    
    }
    
    function magazine_body_class( $classes ) {
    
    	$classes[] = 'magazine-home';
    
    	return $classes;
    
    	
    
    }
    
    function magazine_homepage_widgets() {
    
    	genesis_widget_area( 'home-top', array(
    
    		'before' => '<div class="home-top widget-area">',
    
    		'after'  => '</div>',
    
    	) );
    
    	genesis_widget_area( 'home-middle', array(
    
    		'before' => '<div class="home-middle widget-area">',
    
    		'after'  => '</div>',
    
    	) );
    
    	genesis_widget_area( 'home-bottom', array(
    
    		'before' => '<div class="home-bottom widget-area">',
    
    		'after'  => '</div>',
    
    	) );
    
    }
    
    genesis();

    #106257

    braddalton
    Participant
    Post count: 10253

    You may have a recent posts or Genesis Featured Posts widget populated in one of your front page widget areas.

    You can change the widget settings to display 5 posts using the Genesis Featured Posts widget in the Home Bottom widget area.


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

You must be logged in to reply to this topic.