layout(); $wdwt_front->typography(); $wdwt_front->color_control(); $wdwt_front->favicon_img(); $wdwt_front->custom_css(); $wdwt_front->menu_bg_img(); } function wdwt_scripts_front(){ global $wdwt_front; /*---- SLIDER ----*/ $animation_speed = $wdwt_front->get_param('animation_speed'); $effect = $wdwt_front->get_param('effect'); $image_height = $wdwt_front->get_param('image_height'); $stop_on_hover = trim($wdwt_front->get_param('stop_on_hover')); $stop_on_hover = ($stop_on_hover == 'false' || $stop_on_hover == '' ) ? '0' : '1'; $slideshow_interval = $wdwt_front->get_param('slideshow_interval'); $hide_slider = $wdwt_front->get_param('hide_slider'); $imgs_url = $wdwt_front->get_param('slider_head'); $imgs_url = explode('||wd||',$imgs_url); $business_elite_slider_options = array( "animation_speed" => $animation_speed, "effect" => $effect[0], "image_height" => $image_height, "slideshow_interval" => $slideshow_interval, "stop_on_hover" => $stop_on_hover, ); if(($hide_slider[0]!="Hide Slider" && ((is_home() && $hide_slider[0]=="Only on Homepage") || $hide_slider[0]=="On all the pages and posts")) && count($imgs_url) && is_array($imgs_url)){ wp_enqueue_script('business_elite_slider_js',get_template_directory_uri().'/inc/js/slider.js',array('jquery')); wp_localize_script('business_elite_slider_js', 'business_elite_slider_options', $business_elite_slider_options); } /*-----EFFECT FOR HOME PAGE------*/ $effects_array=array( "top_post_effect" => 'none', "feautured_effect" => 'none', "portfolio_effect" => 'none', "contact_effect" => 'none', ); wp_enqueue_script( 'wdwt_custom_js', WDWT_URL.'/inc/js/javascript.js',array('jquery')); wp_localize_script( 'wdwt_custom_js', 'business_elite_admin_ajax', admin_url('admin-ajax.php') ); wp_localize_script( 'wdwt_custom_js', 'business_elite_effects', $effects_array ); wp_localize_script( 'wdwt_custom_js', 'business_elite_site_url', trailingslashit(site_url()) ); wp_localize_script( 'wdwt_custom_js', 'business_elite_is_front', is_front_page() ? '1' : '0' ); wp_enqueue_script('wdwt_scroll_to_div',WDWT_URL.'/inc/js/jquery.scrollTo-min.js'); wp_enqueue_script('jquery-effects-core'); wp_enqueue_script('jquery-effects-explode'); wp_enqueue_script('jquery-effects-slide'); wp_enqueue_script('jquery-effects-transfer'); wp_enqueue_script('wdwt_animate-number',WDWT_URL.'/inc/js/jquery.animateNumber.min.js'); /*------FIX_MENU-------*/ $fixed_menu = $wdwt_front->get_param('fixed_menu'); if($fixed_menu=="on") wp_enqueue_script('scrolling_menu',WDWT_URL.'/inc/js/scrolling_menu.js', array('response'), false); wp_enqueue_script('response', WDWT_URL.'/inc/js/responsive.js', array('jquery'), false); wp_enqueue_style( WDWT_SLUG.'-style', get_stylesheet_uri(), array(), WDWT_VERSION ); wp_enqueue_style( 'slider-style' ,get_template_directory_uri().'/styles/slider.css', array(), WDWT_VERSION ); wp_enqueue_style( 'webdr-effect-style', get_template_directory_uri().'/styles/effects.css', array(), WDWT_VERSION ); wp_enqueue_script('hover_effect',WDWT_URL.'/inc/js/jquery-hover-effect.js'); wp_enqueue_script( 'comment-reply' ); // Styles/Scripts for popup. wp_enqueue_style('wdwt_font-awesome', WDWT_URL . '/inc/css/font-awesome/font-awesome.css', array(), WDWT_VERSION); wp_enqueue_script('wdwt_jquery_mobile', WDWT_URL . '/inc/js/jquery.mobile.js', array(), WDWT_VERSION); wp_enqueue_script('wdwt_mCustomScrollbar', WDWT_URL . '/inc/js/jquery.mCustomScrollbar.concat.min.js', array(), WDWT_VERSION); wp_enqueue_style('wdwt_mCustomScrollbar', WDWT_URL . '/inc/css/jquery.mCustomScrollbar.css', array(), WDWT_VERSION); wp_enqueue_script('wdwt_jquery-fullscreen', WDWT_URL . '/inc/js/jquery.fullscreen-0.4.1.js', array(), WDWT_VERSION); wp_enqueue_script('wdwt_lightbox_loader', WDWT_URL.'/inc/js/lightbox.js', array(), WDWT_VERSION); wp_localize_script( 'wdwt_lightbox_loader', 'admin_ajax_url', admin_url('admin-ajax.php') ); } /*---------------*/ function wdwt_widgets_init(){ /* Area 1, located at the top of the sidebar. */ register_sidebar(array( 'name' => __('Primary Widget Area', 'business-elite'), 'id' => 'sidebar-1', 'description' => __('The primary widget area', 'business-elite'), 'before_widget' => ' ', 'before_title' => '

', 'after_title' => '

', )); /* Area 2, located below the Primary Widget Area in the sidebar. Empty by default. */ register_sidebar(array( 'name' => __('Secondary Widget Area', 'business-elite'), 'id' => 'sidebar-2', 'description' => __('The secondary widget area', 'business-elite'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); /* First footer widget area */ register_sidebar(array( 'name' => __('First Footer Widget Area', 'business-elite'), 'id' => 'primary-footer-widget-area', 'description' => __('Footer widget area', 'business-elite'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); /* Second footer widget area */ register_sidebar(array( 'name' => __('Second Footer Widget Area', 'business-elite'), 'id' => 'secondary-footer-widget-area', 'description' => __('Footer widget area', 'business-elite'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } /*---------------*/ function wdwt_multisite_body_classes($classes){ foreach($classes as $key=>$class) { if($class=='blog') $classes[$key]='blog_body'; } return $classes; } /*------ CALL FUNCTIONS AFTER THEME SETUP --------*/ function wdwt_setup_elements(){ /* add custom header in admin menu */ add_theme_support( 'custom-header', array( 'default-text-color'=> '220e10', 'default-image' => '', 'header-text' => false, 'height' => 240, 'width' => 1024, ) ); /* add custom background in admin menu */ $theme_defaults = array( 'default-color' => 'fffff', 'default-image' => '', ); add_theme_support('custom-background', $theme_defaults ); add_theme_support('title-tag'); if(!get_theme_mod('background_color',false)) set_theme_mod('background_color','ffffff') ; /* For Post thumbnail */ add_theme_support('post-thumbnails'); set_post_thumbnail_size(150, 150); add_image_size( 'business-elite-width', 370,310, true ); /* requerid features */ add_theme_support('automatic-feed-links'); /* include language */ load_theme_textdomain('business-elite', WDWT_DIR.'/languages' ); /* register menu, */ register_nav_menu('primary-menu', 'Primary Menu'); /* for editor styles */ add_editor_style(); if ( ! isset( $content_width ) ) { $content_width = 1024; } } /*------- LIGTHBOX --------*/ function wdwt_lightbox (){ $action = $_POST['action']; if($action == "wdwt_lightbox"){ require_once('inc/front/WDWT_lightbox.php'); $lightbox = new WDWT_Lightbox(); $lightbox->view(); } die(); } function wdwt_front_pages(){ global $wdwt_options; global $wdwt_front; require_once('inc/front/front_params_output.php'); $wdwt_front = new Business_elite_front($wdwt_options); $action = $_REQUEST['action']; $paged = isset($_REQUEST['paged']) ? intval($_REQUEST['paged']) : 0; if($action == "wdwt_front_top_posts"){ require_once('inc/front/front_functions.php'); Business_elite_frontend_functions::top_posts($paged); } if($action == "wdwt_front_portfolio_home"){ require_once('inc/front/front_functions.php'); Business_elite_frontend_functions::portfolio_home($paged); } if($action == "wdwt_front_wd_tabs_dynamic"){ $cat_id = isset($_REQUEST['cat']) ? intval($_REQUEST['cat']) : 0; $key = isset($_REQUEST['key']) ? intval($_REQUEST['key']) : 0; require_once('inc/front/front_functions.php'); Business_elite_frontend_functions::category_tab_ajax($paged, $cat_id, $key); } die(); } /*------- Search filter --------*/ function wdwt_search_filter($query) { if ( !is_admin() && $query->is_main_query() && $query->is_search) { if(isset($_GET['inc-pages'])) $inc_pages=$_GET['inc-pages']; else $inc_pages=''; if(isset($_GET['inc-posts'])) $inc_posts=$_GET['inc-posts']; else $inc_posts=''; if ($inc_posts == "on" && $inc_pages != "on") { $query->set('post_type', 'post'); } else if ($inc_posts != "on" && $inc_pages == "on") { $query->set('post_type', 'page'); } else if ($inc_posts == "on" && $inc_pages == "on") { $query->set('post_type', array('post', 'page')); } else { /*show all custom post types*/ $post_types = get_post_types(array('public' => true, 'exclude_from_search' => false), 'objects'); $all_types = array(); if($post_types) { foreach( $post_types as $type) { $all_types[] = $type->name; } } $query->set('post_type', $all_types); } if (isset($_GET['month']) && $_GET['month'] != "no") { $query->set('year', substr($_GET['month'], 0, 4)); $query->set('monthnum', substr($_GET['month'], 4, 2)); } } } /* This filter will jump into the loop and arrange our results before they're returned */ add_filter('pre_get_posts', 'wdwt_search_filter'); ?>