Community Forums › Forums › Archived Forums › Design Tips and Tricks › Header left and right widgets in Balance Theme
Tagged: balance theme header widgets
- This topic has 10 replies, 4 voices, and was last updated 10 years, 10 months ago by afinevo.
-
AuthorPosts
-
June 13, 2013 at 12:44 pm #45710afinevoMember
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.orgJune 13, 2013 at 5:35 pm #45779afinevoMemberWow, 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.
June 14, 2013 at 12:20 am #45820vividvillaMemberHi 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 hereJune 14, 2013 at 2:19 pm #45973afinevoMemberThanks 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.
June 15, 2013 at 12:12 pm #46131afinevoMemberDoes anyone else have a solution?
Thank you.
June 17, 2013 at 10:39 am #46362afinevoMemberI guess I'll update this one more time. I didn't think this was going to be that hard of a project...
Thanks everyone.
June 17, 2013 at 1:20 pm #46390afinevoMemberAll 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!
June 17, 2013 at 1:40 pm #46392Brad DaltonParticipantYes. 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.
June 17, 2013 at 3:15 pm #46414afinevoMemberThanks 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.
June 17, 2013 at 3:16 pm #46416mumediaParticipantI 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:
- In home.php, remove the Grid loop code that displays the blog posts in the first place. See: http://www.studiopress.community/topic/balance-theme-how-to-change-the-home-page/
- 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/.
June 17, 2013 at 3:37 pm #46424afinevoMemberThanks 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.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.