Minimum Theme: Remove blog posts on home page

Community Forums Forums Design Tips and Tricks Minimum Theme: Remove blog posts on home page

This topic is: not resolved

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

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

    pgless
    Participant
    Post count: 4

    How would the blog posts section be removed from the home page?

    #51783

    braddalton
    Participant
    Post count: 7458

    Simply comment out // the action which adds them in your child themes home.php file:

    //add_action( 'genesis_loop', 'minimum_grid_loop_helper' );
    function minimum_grid_loop_helper() {
    
    	if ( function_exists( 'genesis_grid_loop' ) ) {
    		genesis_grid_loop( array(
    			'features' 				=> 0,
    			'feature_image_size' 	=> 'featured',
    			'feature_image_class' 	=> 'post-image',
    			'feature_content_limit' => 0,
    			'grid_image_size'		=> 0,
    			'grid_image_class'		=> 'alignnone',
    			'grid_content_limit' 	=> 250,
    			'more'					=> __( '[Read more]', 'minimum' ),
    		) );
    	} else {
    		genesis_standard_loop();
    	}
    
    }
    
    genesis();
    

    You can also hide the sidebar on the home page if needed:

    .home .sidebar {
        display:  none;
    }
    

    And the button:

    .home .page-title-button {
        display:  none;
    }
    

    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #51811

    pgless
    Participant
    Post count: 4

    Hi braddalton,

    Thanks for your comments.

    First thing i did was to comment out the section you said in home.php. Great no posts information displayed but the problem is It leaves negative white space:

    /* add_action( 'genesis_loop', 'minimum_grid_loop_helper' );
    function minimum_grid_loop_helper() {
    
    	if ( function_exists( 'genesis_grid_loop' ) ) {
    		genesis_grid_loop( array(
    			'features' 				=> 0,
    			'feature_image_size' 	=> 'featured',
    			'feature_image_class' 	=> 'post-image',
    			'feature_content_limit' => 0,
    			'grid_image_size'		=> 0,
    			'grid_image_class'		=> 'alignnone',
    			'grid_content_limit' 	=> 250,
    			'more'					=> __( '[Read more]', 'minimum' ),
    		) );
    	} else {
    		genesis_standard_loop();
    	}
    
    } */
    
    genesis();
    

    <p>Looking in the CSS file, the following is missing:</p>
    <pre class="brush: css; title: ; notranslate" title="">
    .home .sidebar {
    display: none;
    }

    <p>Closest I can find is:</p>
    <pre class="brush: css; title: ; notranslate" title="">
    .home .minimum #inner {
    display: none
    }

    <p>And the button:</p>
    <pre class="brush: css; title: ; notranslate" title="">
    .home .page-title-button {
    display: none;
    }

    <p>What do you reckon?</p>

    #51847

    braddalton
    Participant
    Post count: 7458

    Use Firebug to inspect the different elements you want to hide.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

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

You must be logged in to reply to this topic.