Bitdoz

  • Donate!
  • Topics
    • SEO
    • Social Media
    • Tutorial
      • Tips
    • Blogging
      • Genesis
      • WordPress
    • Review
    • Mobiles and Tablets
  • About Me
  • Contact
Genesis

How to Use Custom Sidebar on Homepage in Genesis Framework

January 28, 2014 By Sachin Verma 6 Comments

How to Use Custom Sidebar on Homepage in Genesis Framework

I am using a custom sidebar for homepage of Bitdoz, my sidebar on homepage has less widgets than the other pages. In this tutorial, I will use the easiest method to add custom sidebar on homepage in Genesis blog. There are few methods already on other sites that I saw, most of them include adding a custom sidebar PHP file using FTP, beginners might not be comfortable with those tutorials, so I will only make us of the functions.php file in this tutorial.

I have already written few tutorials for Genesis framework including Custom Social Share buttons for Genesis and Horizontal Subscribe Box for Genesis. This is another tutorial in the same series and I will be posting more soon.

How to Use Custom Sidebar on Homepage in Genesis Framework

  1. Registering the Custom Sidebar
  2. Removing the default sidebar and adding our custom sidebar conditionally
  3. Adding desired widgets to our custom sidebar

How to Register a Custom Sidebar in Genesis

To register a custom sidebar open the functions.php file of your Genesis child theme by going to Dashboard > Appearance > Editor and add the code below to the functions.php file. This will register a custom sidebar with name Custom Homepage Sidebar.

How to Add Custom Sidebar to Homepage Conditionally

Further add the following code to the same functions.php file of your Genesis child theme, we are using is_home() conditional tag to show this custom sidebar on homepage only. The remove_action code will remove the default Genesis sidebar from homepage only, as it is also inside the conditional tag. If you need more information about the codes being used, leave a comment with question.

Add the Desired Widgets to Custom Homepage Sidebar

How to Use Custom Sidebar on Homepage in Genesis FrameworkIf the above codes are added correctly, the sidebar will appear in Dashboard > Appearance > Widgets with name Custom Homepage Sidebar as in the screenshot, add your desired widgets to the sidebar and you are done. Test the sidebar by adding different widgets to your default sidebar and homepage sidebar.

If you still have any questions regarding this tutorial leave a comment below.

 

 

Reference:

Use a Custom Sidebar on a Custom Post Type : Carrie Dils

About Sachin Verma

My name is Sachin Verma, I am a student, freelance web designer and a blogger, I love to play computer games.
Follow Sachin Verma on Google Plus, Facebook and Twitter.

Comments

  1. Lara Schenck says

    May 22, 2014 at 4:04 pm

    Very helpful article, thank you!

    Just letting you know there is an error on line 10 of your second gist with bitdoz_do_sidebar – there are extra parens in genesis_widget_area()(…).

    Thanks again!
    Lara

    Reply
    • Sachin Verma says

      May 22, 2014 at 4:12 pm

      Thanks for notifying, I didn’t test the code after editing the post last time. 🙂

      Reply
  2. Amy says

    May 29, 2014 at 9:24 pm

    This added a home page sidebar on the back-end of the site. But, it isn’t pulling on the home page. Do I also need to add something to the home.php file?

    Thanks!

    Reply
  3. Ali says

    July 2, 2014 at 12:28 pm

    Hello,

    The code is working fine here but would you please tell me how to set a different class other than “sidebar-primary” for the new sidebar ?

    Thank you

    Reply
  4. Smachizo says

    August 22, 2015 at 7:39 pm

    Thank you,
    I found a way to add custom sidebar on home page by uploading a home-sidebar.php to my child theme but it didnt work,
    and then i’ve landed to this page and your codes work.
    Thank yoou again.sorry for my bad english

    Reply
  5. Josh says

    May 18, 2016 at 9:54 pm

    Very helpful, thank you!

    Reply

Comment Policy:
Your words are your own, so be nice and helpful if you can. Please, only use your real name and try to contribute to the discussion.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get Regular Updates and Freebies

Sign up now to receive regular updates and freebies direct to your inbox!

Copyright © 2015 ·Bitdoz · Genesis Framework by StudioPress · Sitemap · Contact us · Privacy Policy