Showcase - Theme Frameworks

Now that we have launched the Genesis Theme Framework and have some child themes available, I thought it would be helpful to spend some more time explaining the basics of Genesis. Hooks 101 – A Basic Guide for the StudioPress Genesis Theme Framework is the second article.

What is a Hook?

A hook is a piece of code written into a theme, that allows you to attach additional content to the theme itself. In other words, it provides the ability to extend functionality by way of inserting (or hooking) code. The Genesis theme framework has over 40 locations throughout the theme where you can do this – to see a comprehensive list of these locations, you can take a look at the Genesis Hook Reference page.

What Does a Hook Look Like in a Theme File?

If you open up any of the Genesis Theme Framework files, you’ll be able to spot many of them. For instance, if you open up the footer.php file, you’ll see this code:

<?php genesis_before_footer(); ?>
<div id="footer">
<div class="wrap">
<?php genesis_footer(); ?>

The very first line of this code is considered a hook – what this does is allow you the ability to add content or “hook” the content to a specific location. In this case, you’ll see that it occurs before the footer.

What is an Example of Using a Hook?

Many folks like the idea of a widgeted footer area, but not all of our themes have one. A perfect example of what you can do with a hook is to add a widgeted footer area above the footer. Below is an explanation how you would do that.

Step #1
Create a new file and place it into your child theme folder. Name it something that makes sense for what content it contains… bottom-widgets.php

Step #2
Use this file just like you would use a sidebar.php file. Insert your markup and additional CSS, do the conditional widget calls, etc. For complete code, you can refer to this tutorial.

Step #3
Now, you want to create a function that will allow the contents of your bottom-widgets.php file to be hookable – which you can do by adding this code to your child theme’s functions.php file:

function include_bottom_widgets() {
    require(CHILD_DIR.'/bottom-widgets.php');
}

Step #4
Now we want to instruct the child theme to execute the function from Step #3 directly above the footer. No problem… we’ll use a hook – so you would place this code to do it:

add_action('genesis_before_footer', 'include_bottom_widgets');

What that line of code does is tells the Genesis engine… take the include_bottom_widgets function, and attach it to the genesis_before_footer hook, and execute. If you open up genesis/footer.php you can see the exact location of the genesis_before_footer() hook so you’ll know where your function is going to execute.

The Result
This process is like inserting code directly in the parent theme files, only slightly different. Instead of inserting the code directly, you attach it to hooks that have been placed in various locations throughout the genesis source code. Your final product looks like this in your child theme’s functions.php file:

add_action('genesis_before_footer', 'include_bottom_widgets');
function include_bottom_widgets() {
    require(CHILD_DIR.'/bottom-widgets.php');
}

Additional Benefits

By using Hooks, you can simplify your design process and future theme management/maintenance because you only need to create the additional functionality code once and have it stored in the file you created (in this example, bottom-widgets.php), but you can hook it into multiple locations on your Theme. No more repetition of code blocks hard-coded into several various templates, you will have it in one file. Whenever you tweak or update it, that change will affect all areas of your theme where you have it hooked to.

With the launch of Genesis in the rear view mirror, I thought it would be helpful to start introducing some of the elements of a theme framework. They are a relatively new thing in the WordPress world and a lot of people either don’t know what one is or how they work.

What is a Theme Framework?

In short, a theme framework is a robust WordPress theme that can be utilized out of the box as is, but also easily extended with child themes and hooks. Not only do they provide a number of enhancements above a typical WordPress theme, but they also serve as a platform to build upon for additional functionality. This post will focus exclusively on the Genesis theme framework and how it is structured.

What is a Child Theme?

A child theme is an extension of a theme framework which is comprised of typical theme elements – with Genesis, it includes a screenshot, theme files, a stylesheet, a functions file and an images folder. These elements are grouped together in what’s known as a child theme folder and can be activated like any other WordPress theme. To help explain the relationship of a child theme and the parent Genesis theme framework, I’ll go into detail with each one.

A Screenshot

All WordPress themes have a screenshoot image included – typically this is called “screenshot.png”, is 600 x 450 in dimension and is a visual display of the theme, which can be seen on the Appearance > Themes page inside your WordPress dashboard. Since child themes have their own folders and are activated like any other theme, they require a screenshot like a standard theme.

Theme Files

The Genesis theme framework, which in essence is the parent theme, is where all of the theme files are kept. This would include the typical theme files such as 404.php, comments.php, footer.php, header.php, index.php, page.php, single.php and so on. Child themes can also include these files – and the hierarchy works in a way that if any of those files exist in the child theme folder, they will override the parent theme. In other words, if you customize a footer.php file and place it into your child theme folder, that will be used in lieu of the one in the Genesis parent theme. Currently the only theme files that may be found in some of the Genesis child themes are a custom home.php file, which will control the way a site’s homepage will appear. If one is not a part of a child theme, then the theme will use the index.php file, in the Genesis-parent theme, for the homepage.

A Stylesheet

Many theme frameworks are built in a way that imports the parent theme stylesheet, then allows for customizations to be made by way of the child theme stylesheet. While there is nothing wrong with the way that works, we’ve chosen to simplify things and just give the child theme it’s own stylesheet. In other words, if a child theme is being used, the style.css file in the child theme folder has complete control over the way the child theme looks. You don’t have to compare and sift through multiple stylesheets to look for and change style elements.

A Functions File

Most WordPress themes have a functions.php file – which is typically a file where you can control certain behaviors of how WordPress is run or how the theme outputs various things. For instance, a functions file can register sidebar widgets and how they are styled, as well as a number of other “function” related things. With Genesis, the functions.php is simple – it calls the entire theme framework to run and that is the only code found there. The great thing about the way Genesis is built, is that the child theme’s functions file is where a number of things occur – additional sidebar widgets can be registered, and from a development side, custom functions are defined as well as filtered and hooked. (more on that in upcoming posts.)

An Images Folder

This one is pretty self-explanatory – as with any WordPress theme, there is an images folder which is used to hold any images that a theme requires. Use this to hold background images, icons, navbar gradients, and what not.

In Conclusion

The easiest way for me to explain the relationship between a parent theme and child theme, at least in Genesis’ case is to relate it to a cell phone. The Genesis parent theme is the cell phone, and the child theme is the case you hold it in. You’ll always use the same phone, but if you want to change the way it looks on the outside, you put a cover on it to make it look different. The same holds true with a child theme – as that is what “decorates” the way your theme looks.

We are very happy to announce the release of the Genesis Theme Framework. This has been an ongoing development project for over two months and we’re ready for liftoff! In addition, we’re also pleased to announce that two child themes are available – the Executive child theme and the Mocha child theme.

About the Genesis Theme Framework

The Genesis Theme Framework is built on a simple vanilla blog-type parent theme, and can be extended with the use of child themes. Each child theme will come with it’s own home file, which will make extending the parent theme very easy. It will also have it’s own functions file as well. In addition, we’ve built some custom widgets that will make adding content much easier on the User.

Here’s a List of Custom Widgets We’ve Built

  • My Tweets – displays an unordered list of your latest Tweets (view widget)
  • User Profile – displays the Gravatar of a user, as well as their biography and a link to an about page (view widget)
  • eNews & Updates – displays an opt-in box for users to sign up for delivery of your posts by email (view widget)
  • Featured Posts – displays post excerpts and a thumbnail to be used in a homepage featured section (view widget)
  • Featured Page – displays page excerpts and a thumbnail to be used in a homepage featured section (view widget)

The Genesis Theme Framework Marketplace

We are also in the preliminary stages of the Genesis Theme Framework marketplace, which will allow designers to develop/sell child themes here on StudioPress. You can take a look to see what a featured Designer page will look like. There are two ways to be involved in the Genesis Theme Marketplace:

  1. Designers can submit PSD designs, which StudioPress will be responsible for coding
  2. Developers can submit full child themes, which we will review for code compatibility, efficiency, etc

Now’s the Time to Become (or Upgrade to) Our Pro-Plus Membership

If you have been sitting on the fence about becoming an All Themes Pro-Plus member here at StudioPress, now’s the time – as of Monday February 8th, we will be increasing our package to $249.95. Until then, we will be maintaining our current $199.95 price – which is a complete steal if you think about it. With the launch of the Genesis Theme Framework, and a number of child themes in development, you won’t find a better bargain. And oh, did I mention that the Pro-Plus membership includes access to and support for all StudioPress current and future themes/child themes, too?

BuddyPress Add-Ons Currently in Beta Testing

We’re very happy to say that WPMU/BuddyPress gurus Ron and Andrea Rennick will be developing “add-on” packages that can be purchased/supported at Premium BuddyPress Themes. We felt that made sense, since they both have extensive knowledge with the software and how it can be implemented. You can sign up to test-drive the Genesis theme framework/BuddyPress integration over at their site.

How About Some Customizations?

Even through the beta testing of the Genesis Theme Framework, some of us have used it to launch new site designs. Chris Ford, of Creativity Included and myself have both redesigned our sites with it. Take a look:
Creativity Included

Brian Gardner

As we approach the anticipated public release of the Genesis Theme Framework, here are 5 reasons you should build your site using it. There are many more, of course, but in my opinion these are the biggest (and most significant) ones.

1) Security

We are very happy to announce that Mark Jaquith, lead developer of WordPress has been hired to run a security audit on the Genesis Theme Framework. We take our products (and your security) very seriously here at StudioPress, and want you to have full confidence that the Genesis Theme Framework is as secure as possible. What better way to ensure this, than to hire the best of the best – someone who knows WordPress code and security more intimately than anybody else. Mark can be hired at his consulting firm, Covered Web Services.

2) Post Thumbnails

Many of you are aware of the recent WordPress 2.9 release, which includes the feature to include/use post thumbnails. Currently, StudioPress “classic” themes are using an image-resizing script called TimThumb, but the Genesis Theme Framework will not be using that code and will be serving post thumbnails using the organic way WordPress includes them. While this might seem like a step back, we assure you it’s not. With the ability to create intermediate (or custom) sized thumbnails and upcoming WordPress builds that will include additional thumbnail size options on the media setting page and ultimately auto-sized thumbnailing, we feel this is the best direction to go in. While TimThumb is a great script, we are trying to keep Genesis lightweight and less dependent on 3rd party code.

3) Child Theme Marketplace

Not only does the Genesis Theme Framework have very solid code, which is secure and well-written, it will also boast a child theme marketplace. While the marketplace will initially launch as invite-only, it will provide a variety of professional designs from designers across the internet. We are very excited about this concept and this will give our community a number of designs/layouts to choose from. The child theme marketplace will also give a Genesis user the ability to change their designs, without changing the code or platform on which they’re used to. In other words, if you enjoy all of the custom widgets and features that Genesis has, you can simply redesign your site by using another child theme. Here’s some additional information regarding the marketplace which will help explain our vision.

4) Layout Options

We took it upon ourselves to assume that a user who’s working with the Genesis theme framework would want some flexibility. That’s one of the reasons why it will offer 5 6 default layout options. (An additional Full Width Content option was added after the post was written.) In addition to having 6 universal (or site-wide) layout options, we have also given users the opportunity to select any of them on an individual post/page basis, all without having to create a separate theme template. In other words, if your entire site is using the content/sidebar layout, but you want a sales page to have a full width content layout – not a problem. Its as simple as clicking a button on the write post/page screen, which you can see here.

5) Theme Updates

One of the primary focuses that Nathan and I had while in the development process was to ensure ease of use – both with day to day operations, but also with theme updates. While the current StudioPress “classic” themes have required folks to load updated versions from scratch, and meant that customizations had to be redone – the Genesis Theme Framework should end that. We have spent an enormous amount of time and energy on the parent theme, and the emphasis we made on semantics and careful naming of CSS elements should mean that most (if not all) theme updates will not affect your customizations.

One of the most exciting aspects of Genesis for the StudioPress team is the marketplace idea. We are absolutely pumped about it. As previously mentioned, the marketplace will open as invite-only at first. We’re still nailing down the details of the whole process, so things said here might change.

Here are some of the preliminary ideas we have. Designers/developers can provide designs/child themes that will be sold in the Genesis marketplace (available to StudioPress customers on StudioPress.com and in the Genesis “Purchase Themes” menu page).

There will be two ways to be involved in the Genesis theme marketplace:

  1. Designers can submit PSD designs, which StudioPress will be responsible for coding
  2. Developers can submit full child themes, which we will review for code compatibility, efficiency, etc

If you choose to do so…

  • The StudioPress team must approve all designs, therefore your design must be on par with our themes, and be approved as StudioPress caliber before we add it to the marketplace.
  • StudioPress will evaluate, and likely modify, your code to be fully compliant with the Genesis API, web coding standards, and proper SEO.
  • StudioPress will provide support for all themes sold on the marketplace. Developers do not have to provide support.
  • StudioPress and the individual will split the earnings from single theme sales, with a majority of the sale going to the individual. (exact revenue share to be determined)
  • As part of your agreement, you cannot sell Genesis child themes on your own site. You must sell exclusively via the Genesis marketplace. But feel free to send traffic from your site to the Genesis marketplace or to individual child theme sales pages to boost sales.
  • The benefits of being on the marketplace, as opposed to selling child themes on your own site, is of course — traffic & exposure, and also, the fact that StudioPress will provide support for your theme.

OR … If you choose to sell/give away Genesis child themes on your own site, please note:

  • We ask that you link back to StudioPress (with affiliate links) to encourage people to purchase Genesis
  • We ask that you make it clear that you do not work for StudioPress and are an independent developer
  • We ask that you make it clear that your themes will not be supported by StudioPress

If you play by the rules, and we think your work is good, we’ll be happy to add you to a directory of “additional Genesis theme framework resources”, which will be listed here on the StudioPress site. This will give a huge amount of exposure to developers who’s designs aren’t accepted into the marketplace.

And of course… these terms are subject to change, and they likely will. Just wanted to give you guys the gist of what we’re thinking with the Genesis theme marketplace.

We are very pleased to announce the beta period of the Genesis theme framework has started – this is currently open to StudioPress Pro Plus All-Theme members only. If you have purchased a theme and want to upgrade to that package and receive access to the Genesis theme framework, contact us.

A few very basic rules for the beta testing period and the support forum:

  • We will only be providing support for Genesis through the support forums – not by email, our contact form or anything else.
  • Please provide a link to the site you are using Genesis on – it’s extremely difficult to diagnose problems without seeing it in action.
  • Remember that this is a beta testing period, and that there will be changes to the framework by the time alpha 1.0 comes out.
  • We ask that you refrain from using beta versions of the Genesis theme framework on client sites.

If you are a Pro Plus member, you can visit the support forums and you’ll see a section for Genesis theme framework support. There you will find a thread called “Beta Test Rules & Download” where you can download a copy.

Happy testing!

One of the things we get asked all the time at StudioPress is to offer up various site layouts. Fortunately for you, we have developed the Genesis theme framework to include 5 default layouts, which can be selected in the theme options page. Take a look below and tell us what you think!

Sidebar/Content

Genesis Theme Framework Layout #1

Content/Sidebar

Genesis Theme Framework Layout #2

Content/Sidebar/Sidebar

Genesis Theme Framework Layout #3

Sidebar/Sidebar/Content

Genesis Theme Framework Layout #4

Sidebar/Content/Sidebar

Genesis Theme Framework Layout #5

I am very happy to announce Genesis – an advanced theme framework for WordPress. This project has been in development for quite a while, and was something that has been on my mind for well over a year. We’re closing in on a beta version, something that we are very excited about!
Genesis Theme Framework for WordPress

About the Genesis Theme Framework

The Genesis theme framework is built on a simple vanilla blog-type parent theme, and can be extended with the use of child themes. Each child theme will come with it’s own home file, which will make extending the parent theme very easy to do. It will also have it’s own functions file as well.

A Note to Current Users and Developers

Don’t worry, we have built the Genesis theme framework in a way that will continue making your work of customizing our themes just as easy – if not easier. Theme files will still have organic WordPress code as our theme files do now.

Why Did We Build the Genesis Theme Framework?

The answer is simple – it will allow us to create and make available a number of professionally designed themes with the ease of basing them all on one set of core files. This will make it much easier for those who use our themes.

It’s All About Making Things Easier

When we started development of the Genesis theme framework, we took into consideration that both new WordPress users and advanced WordPress developers would be using it. We have created a number of custom widgets that will make things easier to use and more customizable as well. In addition to that, we’ve also placed over 30 hooks into the theme to give advanced users and plugin developers the ability to hook into various locations throughout the theme.

Here’s a List of Custom Widgets We’ve Built

  • My Tweets – displays an unordered list of your latest Tweets (view widget)
  • User Profile – displays the Gravatar of a user, as well as their biography and a link to an about page (view widget)
  • eNews & Updates – displays an opt-in box for users to sign up for delivery of your posts by email (view widget)
  • Featured Posts – displays post excerpts and a thumbnail to be used in a homepage featured section (view widget)
  • Featured Page – displays page excerpts and a thumbnail to be used in a homepage featured section (view widget)

Extending the Genesis Theme Framework

The Genesis parent theme will serve as the foundation of all of our current themes as well as new themes going forward. You’ll notice the demo site is a simple blog theme – and from there, it can be extended with the use of child themes. All child themes will include their own stylesheet, images folder, home.php file and functions.php file which will register additional widget areas and define custom post thumbnail sizes. Take a look at the Durango child theme, which will be available for purchase.

WordPress 2.9 and Post Thumbnails

With the release of WordPress 2.9, we’ve developed the Genesis theme framework to utilize default post thumbnail functionality. For a number of reasons, we have abandoned the use of Tim Thumb for displaying thumbnails, and will be in a position to easily update as WordPress works towards dynamic resizing. In the meantime, we have built in the ability to display custom thumbnail image sizing.

SEO Optimization

You honestly can’t have a great framework unless you have great SEO built in. Unfortunately for most themes, good SEO is a complex and difficult asset to build in. Fortunately for you, Genesis lays the groundwork for excellent on-site SEO. And because it’s a framework (easy and free to update), the evolving web will be met with an evolving theme, providing you with superior SEO today, tomorrow, and for years to come. Specifically …

  • Site-wide SEO settings so YOU can control what you want the Search Engines to see
  • In-Post SEO to give you even greater control on a per-post and per-page basis
  • Semantic markup for search engine readability
  • Modern, standards-compliant markup structure
  • Lean code for faster search engine crawls
  • An evolving SEO strategy for evolving SEO standards

Because Genesis is a framework upon which many themes will be built, as Genesis evolves, all child themes based on Genesis inherit the benefits. Everybody wins!!!

Layout Options

The Genesis theme framework comes with 3 default layout options – content/sidebar, sidebar/content and sidebar/content/sidebar. This is easily changed on the theme options page, and gives you the flexibility with all themes (Genesis parent and any child themes) to choose whichever layout you want.

Child Theme Marketplace

Once we launch the Genesis theme framework, we will be opening up a child theme marketplace – this is something that will begin as invite-only, in order for us to establish a good process with folks. Ultimately this gives designers a chance to develop child themes based on Genesis and an immediate place to market and sell themes here on StudioPress. This will operate under a revenue share, which is yet to be determined.

Genesis and BuddyPress

We’ve been asked many times if our themes are compatible with BuddyPress, and up until now – we’ve unfortunately had to say no. At this point we’re very happy to say that WPMU/BuddyPress gurus Ron and Andrea Rennick will be developing “add-on” packages that can be purchased/supported on a site of theirs. We felt that made sense, since they both have extensive knowledge with the software and how it can be implemented.

Estimated Release Timeline

The estimated tentative release date for the Genesis theme framework is February 1st, 2010 – though we are planning on making a beta version available to Pro Plus All-Theme members early/mid January for testing.

Nathan Rice Joins the StudioPress Team

Lastly – but certainly not least, I am very happy to announce that Nathan Rice is now a part of the StudioPress team. He’s been working with us since November – and together we have developed the Genesis theme framework. His main role with StudioPress will be Genesis development/support, as well as will be writing a number of plugins and widgets that we plan on releasing to the WordPress community. Nathan and I go years back, and I’m very proud to call him a team member and know that he’ll be an incredible asset to our team.