Skip to content

Instantly share code, notes, and snippets.

Created March 4, 2014 11:57
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 anonymous/9345190 to your computer and use it in GitHub Desktop.
Save anonymous/9345190 to your computer and use it in GitHub Desktop.
Executive Pro Theme Custom Template File Code
<?php
remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );
add_action( ‘genesis_loop’, ‘executive_custom_loop_helper’ );
/*
Template Name: Custom
*/
function executive_custom_loop_helper() {
if ( is_active_sidebar( ‘custom-top’ ) || is_active_sidebar( ‘custom-left’ ) || is_active_sidebar( ‘custom-right’ ) || is_active_sidebar( ‘custom-bottom’ ) ) {
if ( is_active_sidebar( ‘custom-top’ ) ) {
echo ‘<div class=”custom-top”>’;
dynamic_sidebar( ‘custom-top’ );
echo ‘</div><!– end .custom-top –>’;
}
if ( is_active_sidebar( ‘custom-left’ ) || is_active_sidebar( ‘custom-right’ ) ) {
echo ‘<div class=”custom-middle”>’;
if ( is_active_sidebar( ‘custom-left’ ) ) {
echo ‘<div class=”custom-left”>’;
dynamic_sidebar( ‘custom-left’ );
echo ‘</div><!– end .custom-left –>’;
}
if ( is_active_sidebar( ‘custom-right’ ) ) {
echo ‘<div class=”custom-right”>’;
dynamic_sidebar( ‘custom-right’ );
echo ‘</div><!– end .custom-right –>’;
}
echo ‘</div><!– end .custom-middle –>’;
}
if ( is_active_sidebar( ‘custom-bottom’ ) ) {
echo ‘<div class=”custom-bottom”>’;
dynamic_sidebar( ‘custom-bottom’ );
echo ‘</div><!– end .custom-bottom –>’;
}
}
else {
genesis_standard_loop();
}
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment