Header left and right widgets in Balance Theme

Community Forums Forums Design Tips and Tricks Header left and right widgets in Balance Theme

This topic is: not resolved

This topic contains 10 replies, has 4 voices, and was last updated by  afinevo 1 year, 1 month ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #45710

    afinevo
    Participant
    Post count: 61

    Hey everyone.  I’m giving this another shot after the response I received from Copyblogger Media Support.  I just purchased the Balance theme and need to make a static page my home page and want to use the header widgets.  My problem is that apparently the header right and header left widgets will only work if you make a blogroll or post your home page (which doesn’t make any sense to me).  There are examples in the Showcase page of Balance themes with a static home page that uses these widgets successfully.  You can see them here and here.  I don’t have anything loaded up on the site yet, you can find my site here.

    I asked for help here a few days ago and didn’t really get much of a response so I sent in a support ticket for help.  I received the following reply:

    “You could try changing the home.php file name to front-page.php. That may end up require additional customizations though. If you need extra changes to make it all work right please start a thread in the community forum where you can be helped with theme customizations. Thanks”.

    I’m not quite sure what to do with this.  I looked into the php files and there is a separate home.php file, but where to change the name is a bit beyond me.  I don’t customize websites on a daily basis so I’m a little lost here.  Does anyone have any solutions?

    Thanks.

    http://inlandempirehomesolar.org
    #45779

    afinevo
    Participant
    Post count: 61

    Wow, I didn’t know it was going to be this difficult to find an answer.  Could someone possibly point me to someone who may?

    Thanks.

    #45820

    vividvilla
    Participant
    Post count: 34

    Hi the solution is simple.In the left and right sidebar added only in home.php.So what you can do is move that function to functions.php.So add the following code in your functions.php

    add_action( 'genesis_before_content_sidebar_wrap', 'balance_home_loop_helper' );
    
    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 -->';    }}

    If you are not using homepage then delete home.php file.


    Vivek R – @vividvilla
    Genesis Child Theme Designer and Blogger at WPStuffs.
    For affordable Genesis Child Theme design and Customization Contact me here

    • This reply was modified 1 year, 1 month ago by  vividvilla.
    • This reply was modified 1 year, 1 month ago by  vividvilla.
    • This reply was modified 1 year, 1 month ago by  vividvilla.
    • This reply was modified 1 year, 1 month ago by  vividvilla.
    #45973

    afinevo
    Participant
    Post count: 61

    Thanks for the help Vividvilla.  I pasted the code to the functions php file as instructed and the header left and right widgets worked for the home page.  It created a problem however.  I have the Sample Page as my static front page which is the Home page right now.  I’m not uploading any content right now because I’m testing how the site works first.  The only page I have created so far was a privacy policy page for Google Adsense which was created with a plugin.  Once I activated the new functions code, the widgets showed on the home page but all information for the Privacy page was blank.  When I clicked on the Privacy Page in the menu bar, it would bring up the sample blog post instead even though it wasn’t on the menu.  I had deleted the separate home function php page but it didn’t seem to do anything.  I had to revert everything back, delete the plugin, then reinstall it to create the Privacy Page again.  I’m back to where I started.

    What went wrong?

    Thanks.

    • This reply was modified 1 year, 1 month ago by  afinevo.
    • This reply was modified 1 year, 1 month ago by  afinevo.
    #46131

    afinevo
    Participant
    Post count: 61

    Does anyone else have a solution?

    Thank you.

    #46362

    afinevo
    Participant
    Post count: 61

    I guess I’ll update this one more time.  I didn’t think this was going to be that hard of a project…

    Thanks everyone.

    #46390

    afinevo
    Participant
    Post count: 61

    All right!  I have it working now thanks to some outside help with adding it correctly to my functions php file.  It now shows up on every page or post if I activate the widgets.  Does anyone know how I can make it selective?  In other words, is there a way for me to decide which pages or posts I would like like these widgets to work.  I need them on my home page, but I don’t necessarily need them on a privacy page for example.

    Thanks in advance!

    #46392

    braddalton
    Participant
    Post count: 8797

    Yes. Can you paste the code on Pastebin or Github Gists and link to it here please.

    You can easily add a conditional tag so it only displays where you want.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #46414

    afinevo
    Participant
    Post count: 61

    Thanks for responding Brad.  This has been a tough one to get answers to for some reason.  I created a Gist as you suggested and pasted the functions.php file.  The code which I used from above starts on line 108.  Please let me know if you need anything else.

    Thanks so much.

    #46416

    mumedia
    Participant
    Post count: 1

    I hate to make you backtrack, but rather than trying to add the featured widgets to your pages and then make it selective for only the home page, wouldn’t it be better to start afresh and change home.php so that it doesn’t show posts and instead show static content?

    You’d do the following:

    1. In home.php, remove the Grid loop code that displays the blog posts in the first place. See: http://www.studiopress.com/forums/topic/balance-theme-how-to-change-the-home-page/
    2. Register and add a widget area so that you can have static text. See: http://designsbynickthegeek.com/tutorials/add-widgeted-sidebar or http://my.studiopress.com/tutorials/register-widget-area/.
    #46424

    afinevo
    Participant
    Post count: 61

    Thanks for the input Mumedia.  I’m not trying to make the widgets selective for only a home page.  I like having them active on both the posts and static pages for the type of website I’m building right now, however I would like the option of being selective on which pages I would not like them to be activated such as privacy, contact, or about pages for example.

     

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

You must be logged in to reply to this topic.