• 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

Balance Theme – Replace Home Page Posts with Widget

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 › Balance Theme – Replace Home Page Posts with Widget

This topic is: not resolved

Tagged: Balance, widgets

  • This topic has 14 replies, 3 voices, and was last updated 12 years ago by jenwilson.
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • January 20, 2014 at 10:44 am #86117
    jenwilson
    Member

    I would like to replace the "recent posts" section of the home page with just a text widget area. I have registered additional widget areas before but only in the sidebar.

    Any or help or direction would be greatly appreciated.

    http://agentsolutions.ca/mwpdemo
    January 20, 2014 at 2:04 pm #86141
    jenwilson
    Member

    Hey there,

    I was able to get a widget registered for the home page, however there is a slight alignment issue. The sidebar is being pushed down.

    Any suggestions how I resolve the alignment so the sidebar sits normally to the right of the widget and post area?

    Thanks in advance. 🙂

    January 21, 2014 at 10:23 am #86283
    jenwilson
    Member

    Morning...

    Still looking for a bit on input on this one. 🙂

    January 22, 2014 at 10:07 am #86472
    jenwilson
    Member

    Still trying to work this out. Any help or direction would be greatly appreciated.

    Thanks

    January 22, 2014 at 11:13 am #86484
    John
    Participant

    Hi Jennifer,

    It looks like you might have added the new widget area in the wrong place, or something along those lines, since your sidebar is now outside of your "content-sidebar-wrap" div container.

    John


    John Sundberg | blackhillswebworks.com
    A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉

    January 22, 2014 at 11:17 am #86485
    jenwilson
    Member

    Thank you so much John. This is the code I used:

    Step 1

    genesis_register_sidebar( array(
        'id' => 'home-featured',
        'name' => __( 'Home Featured', 'balance' ),
        'description' => __( 'This is the home featured section.', 'balance' ),
    ) );

    Step 2

    /** Add the home featured section */
    add_action( 'genesis_before_loop', 'balance_home_featured' );
    function balance_home_featured() {
    
        /** Do nothing on page 2 or greater */
        if ( get_query_var( 'paged' ) >= 2 )
            return;
    
        genesis_widget_area( 'home-featured', array(
        'before' => '
    ',
        ) );
    
    }

    Step 3

    .home-featured {
        background-color: #f5f5f5;
        border: 1px solid #ddd;
        float: left;
    }

    Not sure exactly where I went wrong. :-/

    January 22, 2014 at 11:23 am #86488
    John
    Participant

    Where did you add the code in steps 1 and 2?


    John Sundberg | blackhillswebworks.com
    A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉

    January 22, 2014 at 11:27 am #86490
    jenwilson
    Member

    Step 1 - Added to the bottom of the functions.php file

    Step 2 - Added directly after the <?php of the home.php file

    January 22, 2014 at 12:18 pm #86499
    John
    Participant

    If I were doing this, I would probably handle step 2 differently.

    Instead, in home.php I would copy the two sections of code for the home-featured-left and -right widget areas, paste that code below those sections (and above the 'loop' actions, and then modify the code to reflect the 'home-featured' widget area you're wanting to achieve.

    Then I would comment out the line that says

    
    add_action( 'genesis_loop', 'child_grid_loop_helper' );
    

    or just remove it and the child_grid_loop_helper function.

    Finally, finish with whatever CSS edits are necessary to complete.


    John Sundberg | blackhillswebworks.com
    A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉

    January 22, 2014 at 12:31 pm #86502
    jenwilson
    Member

    Hmmmm... I will see if I can follow that.

    What do you mean by "comment out"...

    Thanks a lot for helping out with this.

    January 22, 2014 at 12:39 pm #86505
    John
    Participant

    In PHP you can comment out a line by adding // to the beginning of that line. Or you can comment out a block of PHP code by wrapping it in /* and */, much like CSS comments.

    When you comment something in the code, your server ignores whatever is in the commented area.


    John Sundberg | blackhillswebworks.com
    A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉

    March 4, 2014 at 1:07 pm #93406
    JohnsonMktg
    Member

    I'm having a similar issue with the Education theme.... I've registered an extra widget in the functions.php file using:

    genesis_register_sidebar( array(
    	'id'			=> 	'close',
    	'name'			=>	__( 'Close', 'education' ),
    	'description'	=>	__( 'This is the close section displayed below the call to action banner.', 'education' ),
    
    ) );

    and then added the widget hook to the home.php file as follows:

    /** Add the home close section */
    add_action( 'genesis_before_loop', 'education_close' );
    function education_close() {
    
        /** Do nothing on page 2 or greater */
        if ( get_query_var( 'paged' ) >= 2 )
            return;
    
        genesis_widget_area( 'close', array(
        'before' => '
    ',
        ) );
    
    }

    however, no matter where i put the code to the home.php it shoves my sidebars underneath.... so any help would definitely be appreciated

    March 4, 2014 at 2:57 pm #93415
    John
    Participant

    JohnsonMktg,

    A link to your site would help.

    John


    John Sundberg | blackhillswebworks.com
    A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉

    March 5, 2014 at 7:59 am #93512
    JohnsonMktg
    Member

    I figurd it out John... Thanks tho! However, Jen here is the code in the home.php i used after registering the new widget in functions.php:

    /** Add the home close section */
    add_action( 'genesis_after_content', 'education_close' );
    function education_close() {   
    /** Do nothing on page 2 or greater */
        if ( get_query_var( 'paged' ) >= 2 )
            return;
    
        genesis_widget_area( 'close', array(
        'before' => '<div class="after-post widget-area">',
    			'after' => '</div>',
      ) );
    
    }

    All you should have to do is change the "education_close" to balance_home_featured or and "close" to home_featured or whatever your new widget name is and it should work perfectly!

    March 5, 2014 at 9:26 am #93527
    jenwilson
    Member

    I will give it a go. Thank you JohnsonMktg. 🙂

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 15 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

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