When I was checking out Expose Child Theme at StudioPress, I was slightly disappointed that when I clicked on a category that it didn't resemble the homepage in any way. Personally, I would love to see an option in Theme Settings that asked whether I wanted to have my category archive pages to reflect the homepage or a normal category archive page as they have now. While I have taken the home template and dubbed it into a category template, more things can easily be added. If you want to download the file: [download id="3"].
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.
Prevent WordPress from Inserting Paragraph Tags Automatically to Validate Correctly
Ever gotten something like: Line 61, Column 56: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag when you validate your code? This is because by default, WordPress automatically inserts paragraph tags all over the place when displaying ‘the_content’ creating validation issues (inserting implicit <p>). If you want to strip the automatically inserted paragraph tags from your content, simply insert this line in your template file above ‘the_content’ tag:
[php]<?php remove_filter (‘the_content’, ‘wpautop’); ?>[/php]
Another method, if you prefer not to use this one is to insert </p> before <div> or shortcodes like [nggallery id=x]. This will help your pages validate correctly.
Create a Widgetized Ad Area for Genesis
To add ads at the bottom of the posts, you can add ad content space. A good way would be to widgetize it and use Widget Logic to control what ad appears on what page, etc.
So, add this to your functions.php file.
[php]genesis_register_sidebar(array(
'name'=>'Ad Content',
'description' => 'Place widgets here to fill the ad content area that appears after posts.',
));
function add_ad_content() { ?>
<div class="ad_content">
<?php if (!dynamic_sidebar('Ad Content')) : ?>
<h3><?php _e("Ad Content Area", 'genesis'); ?></h3>
<p><?php _e("This is a widgeted area designed to hold ad content.", 'genesis'); ?></p>
<?php endif; ?>
</div><!-- end .homepage_content -->
<?php }
add_action ('genesis_after_post_content','add_ad_content');[/php]
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]
- « Previous Page
- 1
- …
- 49
- 50
- 51
- 52
- 53
- …
- 60
- Next Page »