How to design custom home page

Community Forums Forums Design Tips and Tricks How to design custom home page

This topic is: not resolved

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

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

    theUser
    Participant
    Post count: 3

    Hello there.
    I want to re-design my own blog with a custom home page but I do not know how to start coding. My home page design is about add 5 featured post (widget) before post listing. For reference check out http://goo.gl/2RFse.

    Please advice me.

    Pernando Ritonga

    http://www.techlint.com/
    #47050

    braddalton
    Participant
    Post count: 9215

    You could add 2 widgets using the genesis_before_loop hook and add content columns for 2 and columns to the widgets.

    Another way would be use a custom grid loop or you could create multiple widgets side by side.

    One of the benefits of owning the Pro plus package is the fact you get access to all the code. You could take the code from the home.php file from any child theme and use that in your custom theme. Far easier than writing the code and learning PHP coding.

    Here’s the code for adding one widget area to the home page.

    Please copy this code from the view raw link and paste this code at the end of your child themes functions.php using a code editor.

    You can duplicate this code and change the third parameter from ,5 to ,15. Also change the i.d for the widget.

    Non coders should install WordPress locally and test the code before editing a live site.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #47063

    theUser
    Participant
    Post count: 3
    This reply has been marked as private.
    #47102

    braddalton
    Participant
    Post count: 9215

    Sorry but i don’t receive private replies for some reason. You can contact me using my email brad@wpsites.net


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #47254

    theUser
    Participant
    Post count: 3

    Hello Mr. Dalton. Thank you for your kindness.

    I’m sorry. After my above post, I tried googling and found a few things on Mr Brian site and code snippet/tutorial on my StudioPress account. And I tried a few things.

    Child theme : Goblogoon Theme

    1. I’ve added a widget before content. Here’s my code:

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

    And then, create home.php. Here my code that take it from my balance child theme:

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

    Is it better to use ‘genesis_before_loop’ instead of ‘genesis_before_content’? Advice me, please?

    I see there are some similarities with yours. But the fact is, when I try it (my code) on the local host, it became fullwidth and genesis featured post reduce the number of front-page post. It mean, If I set 10 posts to show at the front page, 5 post for genesis featured widget, then appear 5 post only under widget.

    Q: What’s the different of ‘genesis_before_loop’ and ‘genesis_before_content’? Do I have complete the home.php code?

    Advice me, please?

    I became increasingly curious.

    #47262

    braddalton
    Participant
    Post count: 9215

    The code i embedded doesn’t display any posts on the home page. You can easily create a new page and select the blog page template to display a list of posts.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #47265

    theUser
    Participant
    Post count: 3

    Correction for my no 1 code (functions.php):

    //* Register a new sidebar
    genesis_register_sidebar( array(
    	'id'  			=> 'home-featured-post',
    	'name'			=> __( 'Home Featured Post', 'goblogoon' ),
    	'description'	=> __( 'Featured Post widget before post list!', 'goblogoon' ),
    ) );

    The code i embedded doesn’t display any posts on the home page. You can easily create a new page and select the blog page template to display a list of posts.

    It mean we need to set Reading Setting on Setting Panel WordPress Admin to static page, blog as post page? How about home page section?

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

You must be logged in to reply to this topic.