Created
June 20, 2013 03:55
-
-
Save aaronhartland/5820203 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 -->'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 -->'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 -->'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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