Posts

web-designFor a clients website I need to remove post info for multiple categories. So, here is the code I use to remove genesis_post_info from multiple categories.

Add above code to the bottom of your child theme’s functions.php file.

So, since Genesis 1.6, and probably my favorite part of Genesis 1.6 is the theme support of genesis-structural-wraps. So now you can easily add wraps to the header, nav, subnav, inner, footer-widgets, and footer. If you’ve ever looked at the Visual Markup Guide for the Genesis Framework, you may have noticed that all of the main sections contain a div that wraps around the inner markup except the the ‘inner’ section. Have a look at this:

  • #header > .wrap
  • #nav > .wrap
  • #subnav > .wrap
  • #inner > .wrap, this is what we will be adding
  • #footer-widgets >.wrap
  • #footer > .wrap
Genesis framework

Previously to add an #inner wrap, for example, you had to:
// Add div.wrap inside of div#inner
function child_before_content_sidebar_wrap() {
echo '<div class="wrap">';
}
add_action('genesis_before_content_sidebar_wrap', 'child_before_content_sidebar_wrap');

function child_after_content_sidebar_wrap() {
echo '</div><!-- end .wrap -->';
}
add_action('genesis_after_content_sidebar_wrap', 'child_after_content_sidebar_wrap');

Genesis has made it easy for us to add the additional wrapper by using hooks. All you need to do is open up the functions.php file in your child theme and add the following code. The code should be placed at the end of the file, just before the closing ?> if there is one.
add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'inner', 'footer-widgets', 'footer' ) );

The style changes

By default the sample child theme for  genesis  is boxed in a 960px #wrap that constrains all the elements inside to that width centering them on the page. Find #wrap in your sample child theme style.css around line 162.
Change:
#wrap {
background-color: #fff;
margin: 0 auto 10px;
width: 960px;
}

to:
#wrap {
background-color: #fff;
}

This will remove the contraint and allow our elements inside to span as far as we please.

Add styles for the wrap divs that is inside each our main div structures. This style will set each area to 960px width with the margin:0 auto; centering them on the page.
.wrap {
&nbsp;&nbsp;&nbsp;&nbsp;margin: 0 auto;
&nbsp;&nbsp;&nbsp;&nbsp;width: 960px;
}

NOTE: Can be more specific to each area by adding the id of each section before .wrap for example:
#nav .wrap { width: 900px; }
Will set the nav to be shorter than the other areas.

Find each main structural div and remove its width. The width we set for .wrap will handle this. Search for #header, #nav, #subnav, #inner, #footer-widgets & #footer and remove the width set for each.

Hope this will help you to make your theme more better. 🙂

Sometimes I need to get footer outside of wrap. I tried to find out how can i do that in genesis child theme. This code I got first from Marco who got it from Daisy Olsen.

// Reposition the footer
remove_action('genesis_footer', 'genesis_footer_markup_open', 5);
remove_action('genesis_footer', 'genesis_do_footer');
remove_action('genesis_footer', 'genesis_footer_markup_close', 15);
add_action('genesis_after', 'genesis_footer_markup_open', 5);
add_action('genesis_after', 'genesis_do_footer');
add_action('genesis_after', 'genesis_footer_markup_close', 15);

If you are using Genesis Theme Framework and would like to display Google Adsense or any advertisement code after the first post on the homepage, archives, and search results page, add the code below to the child theme’s functions.php file.
add_action('genesis_after_post', 'aycchildthemes_ad_after_first_post');
function aycchildthemes_ad_after_first_post() {
global $loop_counter;
if (!is_singular() && $loop_counter == 0) { ?>
ADD YOUR GOOGLE ADSENSE CODE HERE
<?php }
}

The code above which you add should be placed anywhere after this:
require_once(TEMPLATEPATH.'/lib/init.php');
And before the following closing code (if it exists):
?>

That’s it. Let me know your experience after using this snippet. Also please share if you have tricks complete this kinda job.