WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Mar 11 2011

Create a Widgeted Home Page for Genesis Prose with Google Ads Spaces

I have never used Google ads, but I believe this is a great way to create a front page with 5 posts - Google Ads - 5 posts - Google Ads.

Create a new blank text file and call it home.php and copy and paste this code into it (or download: [download id="1"]).

[php]<?php get_header(); ?>
<?php genesis_home(); ?>

<div id="home-top-bg">
<div id="home-top">

<div class="home-top">
<?php if (!dynamic_sidebar('Home Top')) : ?>
<div class="widget">
<h4><?php _e("Home Top", 'genesis'); ?></h4>
<p><?php _e("This is a widgeted area which is called Home Top. It is using the Genesis - Featured Posts widget to display desired posts. To get started, log into your WordPress dashboard, and then go to the Appearance > Widgets screen. There you can drag the Genesis - Featured Posts widget into the Home Top widget area on the right hand side.", 'genesis'); ?></p>
</div>
<?php endif; ?>
</div><!-- end .home-top -->

<div class="home-google-ad-area-1">
<?php if (!dynamic_sidebar('Google Ad Area 1')) : ?>
<div class="widget">
<h4><?php _e("Google Ad Area 1", 'genesis'); ?></h4>
<p><?php _e("This is a widgeted area which is called Google Ad Area 1. Use the text widget to move Google Ad information into this area. To get started, log into your WordPress dashboard, and then go to the Appearance > Widgets screen. There you can drag the Text widget into the Google Ad Area 1 widget area on the right hand side.", 'genesis'); ?></p>
</div>
<?php endif; ?>
</div><!-- end .home-google-ad-area-1 -->

<div class="home-bottom">
<?php if (!dynamic_sidebar('Home Bottom')) : ?>
<div class="widget">
<h4><?php _e("Home Bottom", 'genesis'); ?></h4>
<p><?php _e("This is a widgeted area which is called Home Bottom. It is using the Genesis - Featured Posts widget to display desired posts. To get started, log into your WordPress dashboard, and then go to the Appearance > Widgets screen. There you can drag the Genesis - Featured Posts widget into the Home Bottom widget area on the right hand side.", 'genesis'); ?></p>
</div>
<?php endif; ?>
</div><!-- end .home-bottom -->

<div class="home-google-ad-2">
<?php if (!dynamic_sidebar('Google Ad Area 2')) : ?>
<div class="widget">
<h4><?php _e("Google Ad Area 2", 'genesis'); ?></h4>
<p><?php _e("This is a widgeted area which is called Google Ad Area 2. Use the text widget to move Google Ad information into this area. To get started, log into your WordPress dashboard, and then go to the Appearance > Widgets screen. There you can drag the Text widget into the Google Ad Area 1 widget area on the right hand side.", 'genesis'); ?></p>
</div>
<?php endif; ?>
</div><!-- end .home-google-ad-area-2 -->

</div><!-- end #home-top -->
</div><!-- end #home-top-bg -->

<?php get_footer(); ?>[/php]

Then register the widget sidebars by adding the following to your functions.php.

[php]// Register widget areas
genesis_register_sidebar(array(
'name'=>'Home Top',
'id' => 'home-top',
'description' => 'This is the top post section of the homepage.',
'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget'  => '</div>',
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
));
genesis_register_sidebar(array(
'name'=>'Home Bottom',
'id' => 'home-bottom',
'description' => 'This is the bottom post section section of the homepage.',
'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget'  => '</div>',
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
));
genesis_register_sidebar(array(
'name'=>'Google Ad Area 1',
'id' => 'home-google-ad-area-1',
'description' => 'This is the first Google ad section of the homepage.',
'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget'  => '</div>',
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
));
genesis_register_sidebar(array(
'name'=>'Google Ad Area 2',
'id' => 'home-google-ad-area-2',
'description' => 'This is the second Google ad section of the homepage.',
'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget'  => '</div>',
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
));[/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

StudioPress Premium WordPress Themes     WP Engine Managed WordPress Hosting

What can I do for you!?

Custom Development

We develop plugins by determining both business/functional and technical requirements, following WordPress development best practices, and using agile methodology to ensure you get the best solution.

Consulting

Have questions? Need a reliable developer to consult? Please contact us today!

Customized Theme

We can customize your theme or child theme, or create a child theme for you based on your needs while enhancing the performance of every individual attribute.

Customized Plugin

We can customize your plugins, extend plugins (e.g., Gravity Forms, Jetpack, Soliloquy) based on your needs ensuring security, performance, and positive business impact.

Contact Us

About Travis Smith

As a WordPress enthusiast, developer, and speaker, Travis writes about what he learns in WordPress trying to help other WordPress travelers, beginners and enthusiasts with tutorials, explanations, & demonstrations.

Comments

  1. Keith Davis says

    January 30, 2012 at 7:28 am

    Hi Travis
    I Googled “how to set up a widgetised home page for genesis prose theme” and landed here.

    Almost what I was looking for but not quite.

    I’m pretty good with html and CSS but have no PHP, but have been trying to get to grips with registering sidebars etc.

    Do you have a tutorial on “how to set up a widgetised home page for genesis prose theme”?

    Thanks

    Reply
    • Travis Smith says

      January 30, 2012 at 10:32 am

      Hello Keith,

      At this time, I do not have a tutorial on this; however, I will try to write one in the next week.

      Thanks,

      Travis

      Reply
  2. Keith Davis says

    January 30, 2012 at 1:51 pm

    Hi Travis
    Thanks for your reply.
    I picked the Prose theme because it has a standard blog index as the home page so I thought that setting up a widgeted home page for that theme would apply to almost any theme.
    Easy to set up a blog index on any theme, guess all the themes have a blog template.

    I’ve read a few of Nick the Geeks articles on thye vStudiopress forum so I’m getting the idea of Register and then Display sidebars – only just learnt that Sidebar refers to any widgeted area.

    Brian Gardner has also written a short post along those lines.
    http://www.briangardner.com/home-widget-area-eleven40/

    No rush on the tutorial Travis, but I’m sure that a lot of non coders who use Genesis would find it useful to add a custom home page with widfeted areas to a blog style theme.

    Reply
  3. Affan Ruslan says

    February 11, 2012 at 9:54 pm

    Nothing so special with these codes. Basically it just tells you to create home.php file by registering widgetized areas. Do you know how to put adsense between post in BLOG template? The problem when using the home.php template is that the post navigation won’t show up

    Reply
  4. Michelle Cullison says

    March 6, 2013 at 1:40 pm

    Thank you!!! With your help, I widgetized the Home page of the Prose theme.

    Reply

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in