Skip to content

Instantly share code, notes, and snippets.

@aaronhartland
Created June 20, 2013 03:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronhartland/5820203 to your computer and use it in GitHub Desktop.
Save aaronhartland/5820203 to your computer and use it in GitHub Desktop.
<?php
//* Do NOT include the opening php tag
// THis is the code from the home.php file
add_action( 'genesis_after_header', 'enterprise_home_top_helper' );
/**
* Conditionally add Home Top #1 (home-top-1) sidebar and WP-Cycle.
*/
function enterprise_home_top_helper() {
echo '<div id="home-top-bg"><div id="home-top"><div class ="wrap">';
if ( is_active_sidebar( 'home-top-1' ) ) {
echo '<div class="home-top-1">';
dynamic_sidebar( 'home-top-1' );
echo '</div><!-- end .home-top-1 -->';
}
echo '<div class="home-top-2">';
if ( function_exists( 'wp_cycle' ) )
wp_cycle();
echo '</div><!-- end .home-top-2 -->';
echo '</div><!-- end .wrap --></div><!-- end #home-top --></div><!-- end #home-top-bg -->';
}
<?php
//* Do NOT include the opening php tag
add_action( 'genesis_after_header', 'enterprise_home_top_helper' );
/**
* Conditionally add Home Top #1 (home-top-1) sidebar and WP-Cycle.
*/
function enterprise_home_top_helper() {
echo '<div id="home-top-bg"><div id="home-top"><div class ="wrap">';
if ( is_active_sidebar( 'home-top-1' ) ) {
echo '<div class="home-top-1">';
dynamic_sidebar( 'home-top-1' );
echo '</div><!-- end .home-top-1 -->';
}
echo '<div class="home-top-2">';
dynamic_sidebar( 'home-top-2' );
echo '</div><!-- end .home-top-2 -->';
echo '</div><!-- end .wrap --></div><!-- end #home-top --></div><!-- end #home-top-bg -->';
}
<?php
//* Do NOT include the opening php tag
// this is the part of the code from above that pulls in WP-Cycle
echo '<div class="home-top-2">';
if ( function_exists( 'wp_cycle' ) )
wp_cycle();
echo '</div><!-- end .home-top-2 -->';
echo '</div><!-- end .wrap --></div><!-- end #home-top --></div><!-- end #home-top-bg -->';
<?php
//* Do NOT include the opening php tag
// Change the above code in the home.php file to this:
echo '<div class="home-top-2">';
dynamic_sidebar( 'home-top-2' );
echo '</div><!-- end .home-top-2 -->';
echo '</div><!-- end .wrap --></div><!-- end #home-top --></div><!-- end #home-top-bg -->';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment