Site icon WP Smith

How to Widgetize the Home Page of the Expose Genesis Child Theme

In order to widgetize the Expose Child Theme, you have to do three things.

1. Edit the CSS to make .portfolio-posts absolute. So find the following CSS.

[html]#content .portfolio-posts, {
background: #FFFFFF;
float: left;
width: 280px;
min-height: 280px;
margin: 0 10px 10px 10px;
padding: 9px 9px 9px 9px;
border: 1px solid #D5D5D5;
display: inline;
-moz-box-shadow: 0 0 3px #BBBBBB;
-webkit-box-shadow: 0 0 3px #BBBBBB;
overflow: hidden;
}

#content .portfolio-posts h2 {
font-size: 18px;
}

#content .portfolio-posts p {
line-height: 20px;
}[/html]

and delete #content.

2. Edit functions.php to include the widgeted area. Add the following code after // Register widget areas:
[php]genesis_register_sidebar(array(
'name'=>'Home 1',
'id' => 'home-1',
'description' => 'This is the first section of the homepage.',
'before_title'=>'<h3 class="widgettitle">','after_title'=>'</h3>'
));
genesis_register_sidebar(array(
'name'=>'Home 2',
'id' => 'home-2',
'description' => 'This is the first section of the homepage.',
'before_title'=>'<h3 class="widgettitle">','after_title'=>'</h3>'
));
genesis_register_sidebar(array(
'name'=>'Home 3',
'id' => 'home-3',
'description' => 'This is the first section of the homepage.',
'before_title'=>'<h3 class="widgettitle">','after_title'=>'</h3>'
));[/php]

3. Edit home.php to incorporate the widget. Then comment out the following:
[php]//require_once(PARENT_DIR . '/index.php');[/php]

And add the following just after that:
[php]get_header();
genesis_home(); ?>

<div id="content home-widgeted">
<div class="widgeted-home home-1">
<?php if (!dynamic_sidebar('Home 1')) : ?>
<div class="widget">
<h4><?php _e("Home", 'genesis'); ?></h4>
<p><?php _e("This is a widgeted area which is called Home.", 'genesis'); ?></p>
</div>
<?php endif; ?>
</div><!-- end .widgeted-home home-1-->
<div class="widgeted-home home-2">
<?php if (!dynamic_sidebar('Home 2')) : ?>
<div class="widget">
<h4><?php _e("Home", 'genesis'); ?></h4>
<p><?php _e("This is a widgeted area which is called Home.", 'genesis'); ?></p>
</div>
<?php endif; ?>
</div><!-- end .widgeted-home home-2-->
<div class="widgeted-home home-3">
<?php if (!dynamic_sidebar('Home 3')) : ?>
<div class="widget">
<h4><?php _e("Home", 'genesis'); ?></h4>
<p><?php _e("This is a widgeted area which is called Home.", 'genesis'); ?></p>
</div>
<?php endif; ?>
</div><!-- end .widgeted-home home-3-->
</div><!-- end #home-widgeted -->

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

Now, Expose Home Page is widget ready to give more control on the front page. You may need to add some CSS to style even further.