Skip to content

Instantly share code, notes, and snippets.

@woogist
Created June 25, 2014 16:12
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 woogist/df9d532dde14766179c5 to your computer and use it in GitHub Desktop.
Save woogist/df9d532dde14766179c5 to your computer and use it in GitHub Desktop.
Statua theme - fixes the warning division by zero error
<?php get_header(); ?>
<?php global $woo_options; ?>
<?php if ( !isset($woo_options[ 'woo_homepage_layout_choice' ]) ) { get_template_part( 'layouts/home-layout-error' );
} elseif ( is_home() && ( $woo_options[ 'woo_homepage_layout_choice' ] == '0' ) ) { get_template_part( 'layouts/home-layout-error' );
} else { ?>
<?php if ( $woo_options[ 'woo_homepage_layout_choice' ] == 'A' && is_home() && !is_paged() ) get_template_part( 'layouts/home-layout-a' ); ?>
<?php if ( $woo_options[ 'woo_homepage_layout_choice' ] == 'B' && is_home() && !is_paged() ) get_template_part( 'layouts/home-layout-b' ); ?>
<?php if ( $woo_options[ 'woo_homepage_layout_choice' ] == 'C' && is_home() && !is_paged() ) get_template_part( 'layouts/home-layout-c' ); ?>
<?php } ?>
<?php
if ( is_woocommerce_activated() && $woo_options[ 'woo_homepage_featured_products' ] == "true" ) {
echo '<div id="main" class="col-full">';
echo '<h2>'.__('Featured Products', 'woothemes').'</h2>';
$featuredproductsperpage = $woo_options['woo_homepage_featured_products_perpage'];
echo do_shortcode('[featured_products per_page="'.$featuredproductsperpage.'" columns="4"]');
echo '</div>';
}
?>
<?php get_template_part( 'layouts/home-layout-blog-sidebar' ); ?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment