• 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

How to design custom home page

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 › Design Tips and Tricks › How to design custom home page

This topic is: not resolved

Tagged: Custom Home Page, design, featured post

  • This topic has 6 replies, 2 voices, and was last updated 4 years, 8 months ago by theUser.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • June 21, 2013 at 7:22 am #47019
    theUser
    Member

    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/
    June 21, 2013 at 10:14 am #47050
    Brad Dalton
    Participant

    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.


    Tutorials for StudioPress Themes & WooCommerce.

    June 21, 2013 at 11:16 am #47063
    theUser
    Member
    This reply has been marked as private.
    June 21, 2013 at 3:04 pm #47102
    Brad Dalton
    Participant

    Sorry but i don't receive private replies for some reason. You can contact me using my email [email protected]


    Tutorials for StudioPress Themes & WooCommerce.

    June 22, 2013 at 8:42 pm #47254
    theUser
    Member

    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.

    June 22, 2013 at 9:49 pm #47262
    Brad Dalton
    Participant

    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.


    Tutorials for StudioPress Themes & WooCommerce.

    June 23, 2013 at 12:13 am #47265
    theUser
    Member

    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?

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Design Tips and Tricks’ 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

© 2023 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