<?php
/**
* Functions
*
* This is the main functions file that can add some additional functionality to the theme.
* It calls an object from a manager class that inits all the needed functionality.
*/
//declare some global variables that will be used everywhere
$new_meta_boxes=array();
$new_meta_post_boxes=array();
$new_meta_portfolio_boxes=array();
$designare_buttons=array();
$designare_data=new stdClass();
//require('functions/update-notifier.php');
/*----------------------------------------------------------------
* DEFINE THE MAIN CONSTANTS
*---------------------------------------------------------------*/
//main theme info constants
define("DESIGNARE_THEMENAME", 'Walker');
define("DESIGNARE_SHORTNAME", 'walker');
$theme_data = get_theme_data(TEMPLATEPATH . '/style.css');
define("DESIGNARE_VERSION", $theme_data['Version']);
//define the main paths and URLs
define("DESIGNARE_LIB_PATH", TEMPLATEPATH . '/lib/');
define("DESIGNARE_LIB_URL", get_template_directory_uri().'/lib/');
define("DESIGNARE_FUNCTIONS_PATH", DESIGNARE_LIB_PATH . 'functions/');
define("DESIGNARE_FUNCTIONS_URL", DESIGNARE_LIB_URL.'functions/');
define("DESIGNARE_CLASSES_PATH", DESIGNARE_LIB_PATH.'classes/');
define("DESIGNARE_OPTIONS_PATH", DESIGNARE_LIB_PATH.'options/');
define("DESIGNARE_WIDGETS_PATH", DESIGNARE_LIB_PATH.'widgets/');
define("DESIGNARE_SHORTCODES_PATH", DESIGNARE_LIB_PATH.'shortcodes/');
define("DESIGNARE_PLUGINS_PATH", DESIGNARE_LIB_PATH.'plugins/');
define("DESIGNARE_UTILS_URL", DESIGNARE_LIB_URL.'utils/');
define("DESIGNARE_TIMTHUMB_URL", DESIGNARE_UTILS_URL.'timthumb.php');
define("DESIGNARE_IMAGES_URL", DESIGNARE_LIB_URL.'images/');
define("DESIGNARE_CSS_URL", DESIGNARE_LIB_URL.'css/');
define("DESIGNARE_SCRIPT_URL", DESIGNARE_LIB_URL.'script/');
define("DESIGNARE_PATTERNS_URL", get_template_directory_uri().'/images/walker_patterns/');
$uploadsdir=wp_upload_dir();
define("DESIGNARE_UPLOADS_URL", $uploadsdir['url']);
//other constants
define("DESIGNARE_PORTFOLIO_POST_TYPE", 'portfolio');
define("DESIGNARE_TESTIMONIALS_POST_TYPE", 'testimonials');
define("DESIGNARE_SEPARATOR", '|*|');
define("DESIGNARE_OPTIONS_PAGE", 'designare_options');
define("DESIGNARE_GOOGLE_FONTS", "http://fonts.googleapis.com/css?family=Droid+Sans".DESIGNARE_SEPARATOR."http://fonts.googleapis.com/css?family=Droid+Serif:regular,italic,bold".DESIGNARE_SEPARATOR);
/*----------------------------------------------------------------
* INCLUDE THE FUNCTIONS FILES
*---------------------------------------------------------------*/
require_once (DESIGNARE_FUNCTIONS_PATH.'general.php'); //some main common functions
require_once (DESIGNARE_FUNCTIONS_PATH.'sidebars.php'); //the sidebar functionality
if ( isset($_GET['page']) && $_GET['page'] == DESIGNARE_OPTIONS_PAGE ){
require_once (DESIGNARE_CLASSES_PATH.'designare-options-manager.php'); //the theme options manager functionality
}
require_once (DESIGNARE_CLASSES_PATH.'designare-templater.php');
require_once (DESIGNARE_CLASSES_PATH.'designare-custom-data-manager.php');
require_once (DESIGNARE_CLASSES_PATH.'designare-custom-page.php');
require_once (DESIGNARE_CLASSES_PATH.'designare-custom-page-manager.php');
require_once (DESIGNARE_FUNCTIONS_PATH.'custom-pages.php'); //the comments functionality
require_once (DESIGNARE_FUNCTIONS_PATH.'ajax.php'); //AJAX handler functions
require_once (DESIGNARE_FUNCTIONS_PATH.'portfolio.php'); //portfolio functionality
require_once (DESIGNARE_FUNCTIONS_PATH.'testimonials.php'); //testimonials functionality
require_once (DESIGNARE_FUNCTIONS_PATH.'comments.php'); //the comments functionality
require_once (DESIGNARE_WIDGETS_PATH.'widgets.php'); //the widgets functionality
require_once (DESIGNARE_FUNCTIONS_PATH.'options.php'); //the theme options functionality
if(is_admin()){
require_once (DESIGNARE_FUNCTIONS_PATH.'meta.php'); //adds the custom meta fields to the posts and pages
}
//require_once (DESIGNARE_SHORTCODES_PATH.'admin-shortcodes.php'); //the shortcodes functionality
$functions_path = get_template_directory() . '/functions/';
require_once ($functions_path . 'admin-init.php' );
//Trash
if ( ! isset( $content_width ) ) $content_width = 900;
add_filter('get_the_content', 'wpautop');
?>