Balance Theme – change post format on home page

Community Forums Forums Design Tips and Tricks Balance Theme – change post format on home page

This topic is: resolved

This topic contains 6 replies, has 2 voices, and was last updated by  KathleenCD 1 year ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #51051

    KathleenCD
    Participant
    Post count: 22

    Is there a (simple) way of changing how multiple posts show up on the home page. Unless the post titles are the same length, having the posts side by side in 2 colums looks very untidy. I’d like to have them show the same as they do on the blog page – one beneath the other. [ http://testsite2nl.com ]

    Fingers crossed!
    Thanks.

    http://testsite2nl.com/
    #51053

    Doak Heggeness
    Participant
    Post count: 140

    You need to uncomment-out ( /*…*/ ) or delete the ‘grid loop’ in the home.php ( lines 41 – 66 ). Please use a third party app ( cPanel or SFTP ) so you can ‘undo’ any errors. DO NOT delete genesis (); at the bottom of the page.

    /*
    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'child_grid_loop_helper' );
    /** Add support for Genesis Grid Loop **/
    function child_grid_loop_helper() {
    
    	if ( function_exists( 'genesis_grid_loop' ) ) {
    	
    		genesis_grid_loop( array(
    			'features' => 1,
    			'feature_image_size' => 0,
    			'feature_image_class' => 'align none post-image',
    			'feature_content_limit' => 0,
    			'grid_image_size' => 'grid',
    			'grid_image_class' => 'align none post-image',
    			'grid_content_limit' => 0,
    			'more' => __( 'Continue reading...', 'genesis' ),
    			'posts_per_page' => 5,
    		) );
    
    	}
    
    	else {
    		genesis_standard_loop();
    	}
    
    }
    */

    Doak Heggeness, WordPress Development | Website

    #51063

    KathleenCD
    Participant
    Post count: 22

    Thanks for the quick repsonse. I just want to clarify – To comment out I add the /* at the beginning as shown above. Is that the only change or should i insert */ somewhere?

    Your instructions below show both but I only see /* in the code above.
    (You need to uncomment-out ( /*…*/ )

    Tks

    #51067

    KathleenCD
    Participant
    Post count: 22

    Disregard… I just saw the */ at the bottom. sorry!!

    #51070

    KathleenCD
    Participant
    Post count: 22

    I made the change as follows but got a syntax error. Any idea where I went wrong?

    }

    }

    /*
    remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );
    add_action( ‘genesis_loop’, ‘child_grid_loop_helper’ );
    /** Add support for Genesis Grid Loop **/
    function child_grid_loop_helper() {

    if ( function_exists( ‘genesis_grid_loop’ ) ) {

    genesis_grid_loop( array(
    ‘features’ => 1,
    ‘feature_image_size’ => ‘feature’,
    ‘feature_image_class’ => ‘align none post-image’,
    ‘feature_content_limit’ => 300,
    ‘grid_image_size’ => ‘grid’,
    ‘grid_image_class’ => ‘align none post-image’,
    ‘grid_content_limit’ => 0,
    ‘more’ => __( ‘Continue reading…’, ‘genesis’ ),
    ‘posts_per_page’ => 5,
    ) );

    }

    else {
    genesis_standard_loop();
    }

    }
    */

    genesis();

    #51078

    Doak Heggeness
    Participant
    Post count: 140

    Yes, probably, it is easy to create a syntax error ( a semicolon out of place will create one ). Here is the home.php without the grid loop. Copy & paste it or check it against yours.

    <?php
    
    add_action( 'genesis_meta', 'balance_home_genesis_meta' );
    /**
     * Add widget support for homepage.
     *
     */
    function balance_home_genesis_meta() {
    
    	if ( is_active_sidebar( 'home-featured-left' ) || is_active_sidebar( 'home-featured-right' ) ) {
    	
    		add_action( 'genesis_after_header', 'balance_home_loop_helper' );
    
    	}
    }
    
    /**
     * Display widget content for home featured sections.
     *
     */
    function balance_home_loop_helper() {
    
    	if ( is_active_sidebar( 'home-featured-left' ) || is_active_sidebar( 'home-featured-right' ) ) {
    
    			echo '<div id="home-featured"><div class="wrap clearfix">';
    
    			echo '<div class="home-featured-left">';
    			dynamic_sidebar( 'home-featured-left' );
    			echo '</div><!-- end .home-featured-left -->';	
    
    			echo '<div class="home-featured-right">';
    			dynamic_sidebar( 'home-featured-right' );
    			echo '</div><!-- end .home-featured-right -->';
    
    			echo '</div><!-- end .wrap --></div><!-- end #home-featured -->';	
    
    		}
    
    }
    
    genesis();

    Doak Heggeness, WordPress Development | Website

    #51086

    KathleenCD
    Participant
    Post count: 22

    Perfect!!! Thank you so much for helping me with this Doak.

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

The topic ‘Balance Theme – change post format on home page’ is closed to new replies.