<?php
global $eptima_lite_themename;
global $eptima_lite_shortname;

if ( !class_exists( 'OT_Loader' )){	
	//THEME SHORTNAME	
	$eptima_lite_shortname = 'eptima';	
	$eptima_lite_themename = 'eptima-lite';	
	define('EPTIMA_LITE_ADMIN_MENU_NAME','Eptima Lite');
}

/***************** EXCERPT LENGTH ************/
function eptima_lite_excerpt_length($length) {
	return 50;
}
add_filter('excerpt_length', 'eptima_lite_excerpt_length');


/***************** READ MORE ****************/
function eptima_lite_excerpt_more( $more ) {
	return '...';
}
add_filter('excerpt_more', 'eptima_lite_excerpt_more');

/************* CUSTOM PAGE TITLE ***********/
add_filter( 'wp_title', 'eptima_lite_title' );
function eptima_lite_title($title)
{
	$eptima_lite_title = $title;
	if ( is_home() && !is_front_page() ) {
		$eptima_lite_title .= get_bloginfo('name');
	}

	if ( is_front_page() ){
		$eptima_lite_title .=  get_bloginfo('name');
		$eptima_lite_title .= ' | '; 
		$eptima_lite_title .= get_bloginfo('description');
	}

	if ( is_search() ) {
		$eptima_lite_title .=  get_bloginfo('name');
	}

	if ( is_author() ) { 
		global $wp_query;
		$curauth = $wp_query->get_queried_object();	
		$eptima_lite_title .= __('Author: ','eptima-lite');
		$eptima_lite_title .= $curauth->display_name;
		$eptima_lite_title .= ' | ';
		$eptima_lite_title .= get_bloginfo('name');
	}

	if ( is_single() ) {
		$eptima_lite_title .= get_bloginfo('name');
	}

	if ( is_page() && !is_front_page() ) {
		$eptima_lite_title .= get_bloginfo('name');
	}

	if ( is_category() ) {
		$eptima_lite_title .= get_bloginfo('name');
	}

	if ( is_year() ) { 
		$eptima_lite_title .= get_bloginfo('name');
	}
	
	if ( is_month() ) {
		$eptima_lite_title .= get_bloginfo('name');
	}

	if ( is_day() ) {
		$eptima_lite_title .= get_bloginfo('name');
	}

	if (function_exists('is_tag')) { 
		if ( is_tag() ) {
			$eptima_lite_title .= get_bloginfo('name');
		}
		if ( is_404() ) {
			$eptima_lite_title .= get_bloginfo('name');
		}					
	}
	
	return $eptima_lite_title;
}

/**
 * SETS UP THE CONTENT WIDTH VALUE BASED ON THE THEME'S DESIGN.
 */

if ( ! isset( $content_width ) ){
    $content_width = 900;
}

/********************************************************
	#DEFINE REQUIRED CONSTANTS HERE# &
	#OPTIONAL: SET 'OT_SHOW_PAGES' FILTER TO FALSE#.
	#THIS WILL HIDE THE SETTINGS & DOCUMENTATION PAGES.#
*********************************************************/

//CHECK AND FOUND OUT THE THEME VERSION AND ITS BASE NAME

if(function_exists('wp_get_theme')){
    $eptima_lite_theme_data = wp_get_theme(get_option('template'));
    $eptima_lite_theme_version = $eptima_lite_theme_data->Version;  
}

define( 'EPTIMA_LITE_OPTS_FRAMEWORK_DIRECTORY_URI', trailingslashit(get_template_directory_uri() . '/SketchBoard/includes/') );	
define( 'EPTIMA_LITE_OPTS_FRAMEWORK_DIRECTORY_PATH', trailingslashit(get_template_directory() . '/SketchBoard/includes/') );
define( 'EPTIMA_LITE_THEME_VERSION',$eptima_lite_theme_version);	
	
add_filter( 'ot_show_pages', '__return_false' );

// REQUIRED: SET 'OT_THEME_MODE' FILTER TO TRUE.
add_filter( 'ot_theme_mode', '__return_true' );

// DISABLE ADD NEW LAYOUT SECTION FROM OPTIONS PAGE.
add_filter( 'ot_show_new_layout', '__return_false' );

// REQUIRED: INCLUDE OPTIONTREE.
require_once get_template_directory() . '/SketchBoard/includes/ot-loader.php';

// THEME OPTIONS
require_once get_template_directory() . '/SketchBoard/includes/options/theme-options.php';


/********************************************
	GET THEME OPTIONS VALUE FUNCTION
*********************************************/
function eptima_lite_get_option( $option_id, $default = '' ){
	return ot_get_option( $option_id, $default = '' );
}