Your IP : 216.73.216.63


Current Path : /var/www/ya/wp-content/themes/youthy/
Upload File :
Current File : /var/www/ya/wp-content/themes/youthy/sidebar.php

<?php

// Get Theme options for sidebars
$hide_sidebar = get_theme_mod( 'hide_sidebar' , '1' ); // All sidebars
$hide_sidebar_page = get_theme_mod( 'hide_sidebar_page' , '' ); // Page Sidebar
$hide_sidebar_post = get_theme_mod( 'hide_sidebar_post' , '' ); // Post Sidebar
$hide_sidebar_service = get_theme_mod( 'hide_sidebar_service' , '' ); // Service Sidebar
$hide_sidebar_team = get_theme_mod( 'hide_sidebar_team' , '' ); // Team Sidebar


// Never show the sidebar on the homepage template
if( !is_page_template( 't-homepage.php' ) ) {

	// Never show a sidebar if all sidebars are off
	if( $hide_sidebar !== '1' ) {


?>

<div class="sidebar-wrap" id="subnavigation">

	<?php

		// If single and theme options allow, show sidebar
		if ( is_singular('post') && !$hide_sidebar_post ) {
	 			if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar-widgets')) { }
		}

		// If page and not a specific template and theme options allow, show sidebar
		if ( !is_page_template( 't-service.php' ) && !is_page_template( 't-book.php' ) && !is_page_template( 't-team.php' ) ) {
				if ( is_page() && !$hide_sidebar_page ) {
			 			if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar-page-widgets')) {}
				}
		}

		// If singlular service or service template and theme options allow, show sidebar
		if ( ( is_singular('service') || is_page_template( 't-service.php' ) ) && !$hide_sidebar_service ) {
	 			if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('service-widgets')) { }
		}

		// If singlular team or team template and theme options allow, show sidebar
		if ( ( is_singular('team') || is_page_template( 't-team.php' ) ) && !$hide_sidebar_team ) {
	 			if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('team-widgets')) { }
		}



	 ?>

</div>
<?php

		} //END if( $hide_sidebar )

 } // END if not homepage template


// Turn on sidebar
if ( class_exists( 'WooCommerce' ) ) {

	if( get_theme_mod( 'show_sidebar_woocommerce' ) === '1' && !is_shop() && is_woocommerce() && !is_product_category() ) { ?>
		<div class="sidebar-wrap" id="subnavigation">
<?php
		if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('woocommerce-widgets')) { }

	}
	?>
</div>
<?php

}

 ?>