Skip to content

Instantly share code, notes, and snippets.

@tomharrigan
Created February 10, 2014 02:26
Show Gist options
  • Select an option

  • Save tomharrigan/8909350 to your computer and use it in GitHub Desktop.

Select an option

Save tomharrigan/8909350 to your computer and use it in GitHub Desktop.
<?php
// File Security Check
if ( ! function_exists( 'wp' ) && ! empty( $_SERVER['SCRIPT_FILENAME'] ) && basename( __FILE__ ) == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
die ( 'You do not have sufficient permissions to access this page!' );
}
?><?php
/**
* Index Template
*
* Here we setup all logic and XHTML that is required for the index template, used as both the homepage
* and as a fallback template, if a more appropriate template file doesn't exist for a specific context.
*
* @package WooFramework
* @subpackage Template
*/
get_header();
global $woo_options;
$settings = array(
'homepage_enable_slider' => true,
'homepage_slide_type' => 'slides',
'homepage_slide_number' => '2',
'homepage_enable_features' => true,
'homepage_enable_intro_message' => true,
'homepage_enable_popular_posts' => true,
'homepage_enable_testimonials' => true,
'homepage_enable_sensei' => true,
'homepage_enable_recent_posts' => true,
'homepage_enable_our_team' => true
);
$settings = woo_get_dynamic_values( $settings );
?>
<div id="content">
<section id="homepage-content">
<?php
// Display WooSlider if activated and specified in theme options
if ( 'true' == $settings['homepage_enable_slider'] ) {
$slide_type_arguments = array();
if( $settings['homepage_slide_type'] == 'slides' ) {
$slide_type_arguments = array( 'limit' => $settings['homepage_slide_number'], 'imageslide' => 'true', 'overlay' => 'none', 'display_content' => 'false');
} else {
$slide_type_arguments = array( 'limit' => $settings['homepage_slide_number'], 'link_title' => 'true', 'overlay' => 'none', 'display_content' => 'false');
}
do_action( 'wooslider', array( 'slider_type' => $settings['homepage_slide_type'] ), $slide_type_arguments );
}
if ( 'true' == $settings['homepage_enable_features'] ) {
do_action( 'woothemes_features' );
}
$homepage_sections = apply_filters('woo_homepage_order', array(
'intro-message',
'popular-posts',
'testimonials',
'sensei',
'recent-posts',
'our-team'
) );
// Include homepage sections
foreach ( $homepage_sections as $section ) {
if ( 'true' == $settings[ 'homepage_enable_' . str_replace( '-', '_', $section ) ] ) {
if ( $section == 'sensei' && !class_exists( 'Woothemes_Sensei' ) ) continue;
get_template_part( 'includes/homepage/' . $section );
}
}
?>
</section><!-- /#homepage-content -->
</div><!-- /#content -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment