
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php

/* -----------------------------------------------------------------------------

 * Constants

 * -------------------------------------------------------------------------- */

defined( 'PRESSO_THEME_NAME' ) || define( 'PRESSO_THEME_NAME', 'PRESSO' );

defined( 'PRESSO_THEME_VERSION' ) || define( 'PRESSO_THEME_VERSION', '3.0.1' );



/**

 * Set the content width

 */

if ( ! isset( $content_width ) ) {

	$content_width = 1140;

}





/* -----------------------------------------------------------------------------

 * Includes

 * -------------------------------------------------------------------------- */

// require_once get_template_directory().'/inc/amp.php';

require_once get_template_directory().'/inc/archive.php';

require_once get_template_directory().'/inc/author.php';

require_once get_template_directory().'/inc/breaking-news.php';

require_once get_template_directory().'/inc/backstretch.php';

require_once get_template_directory().'/inc/bbpress.php';

require_once get_template_directory().'/inc/cdnjs.php';

require_once get_template_directory().'/inc/comments.php';

require_once get_template_directory().'/inc/custom-css.php';

require_once get_template_directory().'/inc/custom-font.php';

require_once get_template_directory().'/inc/custom-excerpt.php';

require_once get_template_directory().'/inc/extra.php';

require_once get_template_directory().'/inc/facebook-open-graph.php';

require_once get_template_directory().'/inc/instant-search/instant-search.php';

require_once get_template_directory().'/inc/instagram.php';

require_once get_template_directory().'/inc/gallery.php';

require_once get_template_directory().'/inc/menu/editor.php';

require_once get_template_directory().'/inc/menu/menu.php';

require_once get_template_directory().'/inc/menu/walkers.php';

require_once get_template_directory().'/inc/more-article.php';

require_once get_template_directory().'/inc/options.php';

require_once get_template_directory().'/inc/post.php';

require_once get_template_directory().'/inc/post-share.php';

require_once get_template_directory().'/inc/post-views/post-views.php';

require_once get_template_directory().'/inc/review/review.php';

require_once get_template_directory().'/inc/query.php';

require_once get_template_directory().'/inc/schema.org.php';

require_once get_template_directory().'/inc/scroll-to-top.php';

require_once get_template_directory().'/inc/sidebar.php';

require_once get_template_directory().'/inc/social-icons.php';

require_once get_template_directory().'/inc/srcset.php';

require_once get_template_directory().'/inc/shortcodes.php';

require_once get_template_directory().'/inc/simple-page-composer.php';

require_once get_template_directory().'/inc/ticker.php';

require_once get_template_directory().'/inc/utility-functions.php';

require_once get_template_directory().'/inc/wpml.php';

require_once get_template_directory().'/inc/walkers.php';

require_once get_template_directory().'/inc/woocommerce.php';

require_once get_template_directory().'/inc/xss-filters.php';



/**

 * Admin Area

 */

if ( is_admin() ) {

	// Plugin activation

	require_once get_template_directory().'/plugins/plugin-activation.php';

}



/**

 * ACF

 */



if ( ! defined( 'PRESSO_DEV_MODE' ) ) { // do not load under development mode

	if ( ! defined( 'ACF_LITE' ) ) define( 'ACF_LITE' , true );

	require_once get_template_directory().'/inc/acf-fields.php';

}



/**

 * Widgets

 */

require_once get_template_directory().'/widgets/widget-author-list.php';

require_once get_template_directory().'/widgets/widget-custom-banner.php';

require_once get_template_directory().'/widgets/widget-custom-text.php';

require_once get_template_directory().'/widgets/widget-categories.php';

require_once get_template_directory().'/widgets/widget-latest-comments.php';

require_once get_template_directory().'/widgets/widget-posts.php';

require_once get_template_directory().'/widgets/widget-social-counter.php';







/* -----------------------------------------------------------------------------

 * Setup Theme

 * -------------------------------------------------------------------------- */



add_action( 'after_setup_theme', 'presso_theme_setup' );

if ( ! function_exists( 'presso_theme_setup' ) ) {

	function presso_theme_setup() {



		/**

		 * Make theme translatable

		 */

		load_theme_textdomain( 'presso', get_stylesheet_directory() . '/languages' );





		/**

		 * Add supported features

		 */

		add_theme_support( 'automatic-feed-links' );

		add_theme_support( 'post-formats', array( 'audio', 'gallery', 'video' ) );

		add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) );

		add_theme_support( 'title-tag' );





		/**

		 * Define thumbnail sizes

		 */

		add_theme_support( 'post-thumbnails' );

		add_image_size( 'presso_thumbnail_small', 70, 70, true );

		add_image_size( 'presso_thumbnail_small_2', 150, 83, true );

		add_image_size( 'presso_thumbnail_small_3', 116, 92, true ); // 1/3

		add_image_size( 'presso_thumbnail_medium', 335, 186, true ); // 1/3

		add_image_size( 'presso_thumbnail_medium_no_crop', 335, 335, false );

		add_image_size( 'presso_thumbnail_square', 360, 360, true );

		add_image_size( 'presso_thumbnail_large', 700, 394, true ); // 2/3

		add_image_size( 'presso_thumbnail_xlarge', 1080, 608, true ); // full-content-width

		add_image_size( 'presso_thumbnail_full', 1920, 1080, true ); // full screen



		add_image_size( 'presso_thumbnail_block_g', 225, 125, true );



		/**

		 * Register menu

		 */

		register_nav_menus( array(

			'vw_menu_main' => 'Main Menu',

			'vw_menu_mobile' => 'Mobile Menu',

			'vw_menu_top' => 'Top Menu',

			'vw_menu_bottom' => 'Bottom Menu',

		) );



		/**

		 * Setup Filters/Actions

		 */

		

		if ( presso_get_theme_option( 'show_human_diff_time' ) ) {

			add_filter( 'get_the_date', 'presso_human_time_diff', 10, 3 );

		}

	}

}











/* -----------------------------------------------------------------------------

 * Add Custom Image Size To Media Uploader

 * -------------------------------------------------------------------------- */

add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {

	$tabs['description']['title'] = __( 'More Information' );		// Rename the description tab
	$tabs['reviews']['title'] = __( 'Ratings' );				// Rename the reviews tab
	$tabs['additional_information']['title'] = __( 'Specifications' );	// Rename the additional information tab

	return $tabs;

}

add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {

	$tabs['additional_information']['priority'] = 5;	// Additional information third
	$tabs['description']['priority'] = 10;			// Description second
	$tabs['reviews']['priority'] = 15;			// Reviews first

	return $tabs;
}

add_filter( 'image_size_names_choose', 'presso_image_size_names_choose' );

if ( ! function_exists( 'presso_image_size_names_choose' ) ) {

	function presso_image_size_names_choose( $sizes ) {

		$sizes += array(

			'presso_thumbnail_medium' => esc_html__( 'Theme: Medium', 'presso' ),

			'presso_thumbnail_medium_no_crop' => esc_html__( 'Theme: Medium (no cropping)', 'presso' ),

			'presso_thumbnail_square' => esc_html__( 'Theme: Square', 'presso' ),

			'presso_thumbnail_large' => esc_html__( 'Theme: Large', 'presso' ),

			'presso_thumbnail_xlarge' => esc_html__( 'Theme: Extra Large', 'presso' ),

			'presso_thumbnail_full' => esc_html__( 'Theme: Full Width', 'presso' ),

		);



		return $sizes;

	}

}





/* -----------------------------------------------------------------------------

 * Register Theme's Scripts & Styles

 * -------------------------------------------------------------------------- */

add_action( 'wp_enqueue_scripts', 'presso_register_scripts' );

add_action( 'admin_enqueue_scripts', 'presso_register_scripts' );

if ( ! function_exists( 'presso_register_scripts' ) ) {

	function presso_register_scripts() {

		// Register only

		wp_register_script( 'bootstrap-dropdown', get_template_directory_uri().'/js/bootstrap/bootstrap.dropdown.js', array( 'jquery' ), PRESSO_THEME_VERSION, true );

		wp_register_script( 'knob', get_template_directory_uri().'/js/jquery.knob.js', array( 'jquery' ), '1.2.12', true );

		wp_register_script( 'vegas', get_template_directory_uri().'/js/vegas.js', array( 'jquery' ), '2.3.1', true );

		wp_register_script( 'jquery-easy-ticker', get_template_directory_uri().'/js/jquery.easy-ticker.js', array( 'jquery' ), '2.0.0', true );



		if ( is_admin() ) {

			$screen = get_current_screen();

			

			if ( in_array( $screen->id, array( 'post', 'page', 'presso_portfolio', 'presso_gallery' ) ) ) {



				// Bootstrap for admin

				wp_enqueue_style( 'bootstrap-admin', get_template_directory_uri().'/js/bootstrap-admin/bootstrap.css', array(), PRESSO_THEME_VERSION );

				wp_enqueue_script( 'bootstrap-admin', get_template_directory_uri().'/js/bootstrap-admin/bootstrap.js', array( 'jquery' ), PRESSO_THEME_VERSION, true );



				// Libs

				wp_enqueue_style( 'entypo-icon', get_template_directory_uri().'/font-icons/entypo/css/entypo.css', array(), PRESSO_THEME_VERSION );



				// Admin scripts

				wp_enqueue_style( 'presso-css-admin', get_template_directory_uri().'/css/admin.css', array(), PRESSO_THEME_VERSION );



			}



			if ( in_array( $screen->id, array( 'post', 'page', 'presso_portfolio', 'presso_gallery', 'nav-menus' ) ) ) {

				wp_enqueue_style( 'presso-css-admin-mega-menu', get_template_directory_uri().'/css/admin-mega-menu.css', array(), PRESSO_THEME_VERSION );

			}



		} else {

			// Comments

			if ( is_singular() && comments_open() && get_option( 'thread_comments' ) && ! is_page_template( 'page_simple_composer.php' ) ) {

				wp_enqueue_script( 'comment-reply' );

			}



			// Plug and Play

			

			if ( presso_get_theme_option( 'enable_smooth_scroll' ) ) {

				wp_enqueue_script( 'smoothscroll', get_template_directory_uri().'/js/SmoothScroll.js', array( 'jquery' ), '1.4.6', true );

			}

			

			wp_enqueue_script( 'hoverintent', get_template_directory_uri().'/js/jquery.hoverIntent.js', array( 'jquery' ), '1.8.1', true );



			// Font icons

			wp_enqueue_style( 'social-icon', get_template_directory_uri().'/font-icons/social-icons/css/zocial.css', array() );

			wp_enqueue_style( 'entypo-icon', get_template_directory_uri().'/font-icons/entypo/css/entypo.css', array() );



			if ( presso_get_theme_option( 'enable_icon_iconic' ) ) {

				wp_enqueue_style( 'iconic-icon', get_template_directory_uri().'/font-icons/iconic/css/iconic.css', array() );

			}



			if ( presso_get_theme_option( 'enable_icon_elusive' ) ) {

				wp_enqueue_style( 'elusive-icon', get_template_directory_uri().'/font-icons/elusive/css/elusive.css', array() );

			}

			

			if ( presso_get_theme_option( 'enable_icon_awesome' ) ) {

				wp_enqueue_style( 'awesome-icon', get_template_directory_uri().'/font-icons/awesome/css/awesome.css', array() );

			}



			if ( presso_get_theme_option( 'enable_icon_typicons' ) ) {

				wp_enqueue_style( 'typicons-icon', get_template_directory_uri().'/font-icons/typicons/css/typicons.css', array() );

			}





		

			wp_enqueue_script( 'fitvids', get_template_directory_uri().'/js/jquery.fitvids.js', array( 'jquery' ), '1.1.0', true );

			wp_enqueue_script( 'perfect-scrollbar', get_template_directory_uri().'/js/perfect-scrollbar.js', array( 'jquery' ), '0.6.13', true );

			wp_enqueue_script( 'imagesloaded', get_template_directory_uri().'/js/imagesloaded.pkgd.js', array( 'jquery' ), '4.1.1', true );

			wp_enqueue_script( 'isotope', get_template_directory_uri().'/js/isotope.pkgd.min.js', array( 'jquery' ), '3.0.1', true );

			wp_enqueue_script( 'packery-mode', get_template_directory_uri().'/js/packery-mode.pkgd.min.js', array( 'jquery' ), '2.0.0', true );

			wp_enqueue_script( 'jquery-easing', get_template_directory_uri().'/js/jquery.easing.compatibility.js', array( 'jquery' ), '1.3', true );

			wp_enqueue_script( 'magnific-popup', get_template_directory_uri().'/js/jquery.magnific-popup.js', array( 'jquery' ), '1.1.0', true );

			

			wp_enqueue_script( 'superfish', get_template_directory_uri().'/js/jquery-superfish/superfish.js', array( 'jquery' ), '1.7.9', true );

			wp_enqueue_script( 'theia-sticky-sidebar', get_template_directory_uri().'/js/theia-sticky-sidebar.js', array( 'jquery' ), '1.5.0', true );

		

			wp_enqueue_script( 'waypoint', get_template_directory_uri().'/js/waypoint/jquery.waypoints.js', array( 'jquery' ), '4.0.1', true );

			wp_enqueue_script( 'waypoint-inview', get_template_directory_uri().'/js/waypoint/shortcuts/inview.js', array( 'jquery' ), '4.0.1', true );

			wp_enqueue_script( 'waypoint-sticky', get_template_directory_uri().'/js/waypoint/shortcuts/sticky.js', array( 'jquery' ), '4.0.1', true );



			wp_enqueue_script( 'slick', get_template_directory_uri().'/js/slick/slick.js', array( 'jquery' ), '1.6.0', true );

			wp_enqueue_style( 'slick', get_template_directory_uri().'/js/slick/slick.css' );

			wp_enqueue_style( 'slick-theme', get_template_directory_uri().'/js/slick/slick-theme.css' );

			

			// Main script

			wp_enqueue_script( 'presso-js-main', get_template_directory_uri().'/js/main.js', array( 'jquery', 'jquery-effects-core' ), PRESSO_THEME_VERSION, true );

			wp_localize_script( 'presso-js-main', 'vw_main_js', apply_filters( 'presso_filter_localize_main_js', array(

				'is_rtl' => is_rtl(),

				'translation_next' => esc_html__( 'Next', 'presso' ),

				'translation_previous' => esc_html__( 'Previous', 'presso' ),



				'theme_path' => get_template_directory_uri(),

				'ajaxurl' => admin_url( 'admin-ajax.php' ),



				'slider_slide_duration' => presso_get_theme_option( 'slider_slide_duration' ),

				'slider_transition_speed' => presso_get_theme_option( 'slider_transition_speed' ),

				

				'accent_color' => presso_get_theme_option( 'accent_color' ),

			) ) );



			// Main theme

			if ( is_rtl() ) {

				// RTL styles

				wp_enqueue_style( 'presso-css-theme', get_template_directory_uri().'/style-rtl.css', array(), PRESSO_THEME_VERSION );



			} else {

				// Default styles

				wp_enqueue_style( 'presso-css-theme', get_template_directory_uri().'/style.css', array(), PRESSO_THEME_VERSION );

			}



			if ( is_child_theme() ) {

				wp_enqueue_style( 'presso-child-theme', get_bloginfo( 'stylesheet_url' ), array(), PRESSO_THEME_VERSION );

			}

		}

	}

}











/* -----------------------------------------------------------------------------

 * Add Body Classes

 * -------------------------------------------------------------------------- */

add_filter( 'body_class', 'presso_body_class_options' );

if ( ! function_exists( 'presso_body_class_options' ) ) {

	function presso_body_class_options( $classes ) {

		// Site layout class

		$site_layout = presso_get_theme_option( 'site_layout' );

		if ( ! empty( $site_layout ) ) {

			$classes[] = sprintf( 'vw-site--%s', $site_layout );

		}



		// Post layout class for single post page

		if ( is_single() ) {

			$post_layout = presso_get_post_layout();

			$classes[] = sprintf( 'vw-post-layout-%s', $post_layout );

		}



		// Sticky menu

		if ( presso_get_theme_option( 'enable_sticky_menu' ) ) {

			$classes[] = 'vw-enable-sticky-menu';

		}



		// Sticky sidebar

		if ( presso_get_theme_option( 'enable_sticky_sidebar' ) ) {

			$classes[] = 'vw-enable-sticky-sidebar';

		}



		if ( ! presso_get_theme_option( 'enable_fly_in_effect' ) ) {

			$classes[] = 'vw-disable-inview';

			

		}



		return $classes;

	}

}











/* -----------------------------------------------------------------------------

 * The Copyright Text

 * -------------------------------------------------------------------------- */

if ( ! function_exists( 'presso_the_copyright' ) ) {

	function presso_the_copyright() {

		$copyright_text = presso_get_theme_option( 'copyright_text' );

		if ( function_exists( 'icl_t' ) ) {

			$copyright_text = icl_t( PRESSO_THEME_NAME.' Copyright', strtolower( PRESSO_THEME_NAME.'_copyright' ), $copyright_text );

		}

		

		echo '<div class="vw-copyright">';

		echo do_shortcode( esc_html( $copyright_text ) );

		echo '</div>';

	}

}









/* -----------------------------------------------------------------------------

 * Has Title Background

 * -------------------------------------------------------------------------- */

if ( ! function_exists( 'presso_has_title_bg' ) ) {

	function presso_has_title_bg() {

		$hasbg = false;



		if ( presso_is_shop() ) {

			$page_id = presso_get_shop_page_id();



			if ( has_post_thumbnail( $page_id ) ) {

				$hasbg = true;

			}

			

		} elseif ( is_page() && has_post_thumbnail() ) {

			$hasbg = true;

			

		} elseif ( is_single() ) {

			$hasbg = true;



		}



		return $hasbg;

	}

}







if ( ! function_exists( 'presso_remote_get' ) ) {

	function presso_remote_get( $api_url ) {

		$args = array(

			'httpversion' => '1.1',

			'blocking' => true,

		);



		$response = wp_remote_get( $api_url, $args );

		if ( ! is_wp_error( $response ) ) {

			return wp_remote_retrieve_body( $response );

		}

	}

}







/* -----------------------------------------------------------------------------

 * Human Time Diff

 * -------------------------------------------------------------------------- */



if ( ! function_exists( 'presso_human_time_diff' ) ) {

	function presso_human_time_diff( $the_date, $d, $post ) {

		return sprintf( _x( '%s ago', '%s = human-readable time difference', 'presso' ), human_time_diff( get_the_time( 'U' ), current_time( 'timestamp' ) ) );

	}

}





/* -----------------------------------------------------------------------------

 * Admin Notice For Presso 3

 * -------------------------------------------------------------------------- */

add_action( 'after_switch_theme', 'presso_clear_admin_presso3_notice_ignore' );

if ( ! function_exists( 'presso_clear_admin_presso3_notice_ignore' ) ) {

	function presso_clear_admin_presso3_notice_ignore() {

		global $current_user;

	

		$user_id = $current_user->ID;

		delete_user_meta( $user_id, 'vw_presso_3_ignore_notice' );

	}

}



add_action( 'admin_init', 'presso_detect_old_presso' );

if ( ! function_exists( 'presso_detect_old_presso' ) ) {

	function presso_detect_old_presso() {

		$old_options = get_option( 'vw_presso' );



		if ( ! empty( $old_options ) ) {

			global $current_user;

		

			$user_id = $current_user->ID;

			

			presso_ignore_notice_presso3();

			

			if ( ! get_user_meta( $user_id, 'vw_presso_3_ignore_notice' ) ) {

				add_action( 'admin_notices', 'presso_admin_notice_presso3' );

				add_action( 'admin_print_scripts', 'presso_admin_notice_script', 99 );

			}

		}

	}

}



if ( ! function_exists( 'presso_admin_notice_presso3' ) ) {

	function presso_admin_notice_presso3() {

		$class = 'vw-presso3-notice notice notice-error';

		$title = esc_html__( 'Upgrade to Presso 3.x is not recommended for your site', 'presso' );

		$message = sprintf( wp_kses_post( __( 'Old data of Presso 2.x was detected in this site. Please read <a href="%s" target="_blank">this information</a> before using Presso 3.x in this site. You can continue using Presso 2.x, We still support and update for version 2.x.', 'presso' ) ), esc_url( 'http://envirra.com/themes/presso3/document/#migration' ) );



		?>

			<div class="<?php echo esc_attr( $class ); ?>" style="position: relative;">

				<h4><?php echo wp_kses_post( $title ); ?></h4>

				<p><?php echo wp_kses_post( $message ); ?></p>



				<button href="?vw-ignore-presso-3-notice" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.', 'presso' ); ?></span></button>

			</div>

		<?php

	}

}



if ( ! function_exists( 'presso_ignore_notice_presso3' ) ) {

	function presso_ignore_notice_presso3() {

		global $current_user;

		

		$user_id = $current_user->ID;

		

		if ( isset( $_GET[ 'vw-ignore-presso-3-notice' ] ) ) {

			add_user_meta( $user_id, 'vw_presso_3_ignore_notice', 'true', true );

		}

	}

}



if ( ! function_exists( 'presso_admin_notice_script' ) ) {

	function presso_admin_notice_script() {

		?>

<script type='text/javascript'>

	jQuery.noConflict();



	;(function( $, window, document, undefined ){

		"use strict";



		$( document ).ready( function () {

			$( '.vw-presso3-notice .notice-dismiss' ).bind( 'click', function() {

				window.location.href = '?vw-ignore-presso-3-notice';

			} );

		} );



	})( jQuery, window , document );

</script>





		<?php

	}

}