• Skip to content
  • Skip to footer
A Bright Clear Web

A Bright Clear Web

A Bright Clear Web - Simple, effective, accessible websites

  • Home
  • About
  • Websites
  • Writing
  • Learn
  • Blog
  • Contact
You are here: Home / WordPress / A Custom Homepage For The Genesis Framework

A Custom Homepage For The Genesis Framework

Posted: November 6, 2015 Updated: January 4, 2018 by Claire Brotherton
10 Comments

A cottage being constructed

A cottage being constructedI’ve decided to give my homepage a bit of an overhaul.

As I’m using the Genesis Framework, it’s a little more complex than for a standard WordPress theme. Genesis uses its own proprietary system of hooks and filters, so you can’t edit the PHP code hands-on like you might with other themes.

I found some tutorials online, and adapted the code to do what I wanted.

Adding Recent Posts to The Homepage

I modifed the code from Carrie Dils’ tutorial on creating a custom page template in Genesis.

I named my template Claire Homepage and the file claire-homepage.php. You could name yours yourname-homepage.php. Carrie advises not to use a name beginning with page-. You also want to avoid reserved filenames such as index.php.

It needs to go into the folder for your Genesis child theme. In my case, I’m using the Beautiful Pro theme.

Carrie’s code uses a custom loop to display 12 posts from a particular category. I changed mine to show excerpts from the latest 2 posts.

She also includes some custom fields to pull out links to YouTube. I didn’t need this code, so excised it.

My loop looked like this:

To change the number of posts displayed you would just change the number from 2 to whatever you want. I also added a heading before displaying the post excerpts, and a link to the blog page following them.

Adding a widget area

I also wanted to add a widget area underneath the posts. For me, this is to add an email opt-in form, but it could be used to add any widget content.  The first step was to register a widget area in the functions.php file. The standard functions.php is quite long, so I added this at the end of my functions.php. The code is adapted from this tutorial on registering a widget area by StudioPress:

I chose to hook the widget area in after the content using the genesis_after_content hook. That meant adding this code to my template file:

The Genesis Visual Hook Guide is recommended for seeing where all the hooks lie on a page. There’s even a plugin to show where the hooks are in your theme. Finally, at the very end of the template file I needed to call the genesis() function. This function puts the page together. Read more about genesis() in this post from WP Sites, which explains the code fully. My full template file code is here:

Getting it working

Upload the modified files to your child theme folder.

Make sure you have a static home page set in Settings > Reading.

Select the Claire Homepage template (or whatever you have named yours) under Page Attributes > Template.

Don’t forget to add a widget to your widget area in Appearance > Widgets for the widget to show.

Add a little CSS styling if required.

Now you can try creating your own custom homepage for the Genesis framework.

Did you find this post helpful? If so, please share!

Related

Category: WordPress Tags: Genesis

About Claire Brotherton

Freelance web designer and front end developer based in Edinburgh, Scotland. I love WordPress, code, learning and blogging.

Reader Interactions

Comments

  1. Adrianne says

    November 22, 2015 at 6:44 pm

    Hi Claire! Thanks for sharing. Out of curiosity, why did you choose to use a custom naming scheme for your template instead of using a front-page.php template for your homepage?

    Reply
    • Claire Brotherton says

      November 23, 2015 at 11:41 pm

      Hi Adrianne!

      I admit I never thought of using front-page.php. That would have been the obvious thing to do, right enough. 🙂

      Reply
  2. Thames South Shopping Portail says

    November 23, 2015 at 11:23 pm

    I think wordpress is the best and I run a quite few number of them. I think we sometimes find a little bit hard to keep our a bit faster due to the implementation of too many plugins. But I like jetpack. Thanks for this article. Helped me a lot.

    Reply
    • AllTricksZone says

      October 25, 2016 at 6:58 pm

      Really awesome Theme you can also see http://alltrickszone.com with custom modified

      Reply
  3. lh. louis says

    April 11, 2016 at 5:51 am

    Love the info in here, definitely looking for a way to improve the homepage atm, thanks so much.

    Reply
  4. Jayadevan says

    March 6, 2017 at 10:46 am

    Hi can you please share how to add static front page to widgetized homepage in genesis, like after the widgetized homepage instead of showing blog posts can i show a static page so that we can use the widgetized home and a static page together in home.

    Reply
    • Claire Brotherton says

      March 7, 2017 at 6:01 pm

      Hi Jayadevan – thanks for stopping by.

      Perhaps this post from Robin Cornett might help?
      Create a Static Front Page With Widgets, Too

      Reply
  5. Praveen says

    April 6, 2017 at 4:40 pm

    Hi Claire,

    Nice Genesis customisation tips. My site looks cool with Genesis Framework 😉

    Reply
  6. Geekyard says

    April 30, 2017 at 3:46 pm

    Thanks this post helped me to modify my homepage and my blog looks cool with Genesis Framework 🙂

    Reply
  7. Naveen says

    February 22, 2018 at 5:49 pm

    Thanks for sharing the informative article.Amazing content.

    Reply

Leave a Reply Cancel reply

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

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email. Read my privacy policy.

potted cactus and laptop with code

Footer

Categories

  • Accessibility
  • Blogging & Content Marketing
  • Business
  • Personal
  • Software & Tech
  • Websites
  • WordPress

Top Posts

  • How To Create WordPress Excerpts And Include Links In Them
  • How To Solve WordPress Image Alignment And Text-Wrap Problems
  • Improve Your Divi Website's Reach With Divi Accessibility
  • How To Set Up And Customize Twenty Nineteen Theme
  • Registering a Domain Name with GoDaddy - Step by Step

Let’s Be Social

  • E-mail
  • Facebook
  • LinkedIn
  • Twitter
Copyright © 2014 -2025 A Bright Clear Web
  • Privacy and cookies policy
  • Site map