ptions->getOptionsByType('font'))){ $font_field_array = $qodeFramework->qodeOptions->getOptionsByType('font'); } $available_font_options = array_merge($font_sipmle_field_array, $font_field_array); //define available font options array $fonts_array = array(); foreach($available_font_options as $font_option) { //is font set and not set to default and not empty? if(isset($qode_options_proya[$font_option]) && $qode_options_proya[$font_option] !== '-1' && $qode_options_proya[$font_option] !== '' && !qode_is_native_font($qode_options_proya[$font_option])) { $font_option_string = $qode_options_proya[$font_option].':'.$font_weight_str; if(!in_array($font_option_string, $fonts_array)) { $fonts_array[] = $font_option_string; } } } //add google fonts set in slider $args = array( 'post_type' => 'slides', 'posts_per_page' => -1); $loop = new WP_Query( $args ); //for each slide defined while ( $loop->have_posts() ) : $loop->the_post(); //is font family for title option chosen? if(get_post_meta(get_the_ID(), "qode_slide-title-font-family", true) != "") { $slide_title_font_family = get_post_meta(get_the_ID(), "qode_slide-title-font-family", true); $slide_title_font_string = $slide_title_font_family . ":".$font_weight_str; if(!in_array($slide_title_font_string, $fonts_array) && !qode_is_native_font($slide_title_font_family)) { //include that font array_push($fonts_array, $slide_title_font_string); } } //is font family defined for slide's text? if(get_post_meta(get_the_ID(), "qode_slide-text-font-family", true) != "") { $slide_text_font_family = get_post_meta(get_the_ID(), "qode_slide-text-font-family", true); $slide_text_font_string = $slide_text_font_family . ":".$font_weight_str; if(!in_array($slide_text_font_string, $fonts_array) && !qode_is_native_font($slide_text_font_family)) { //include that font array_push($fonts_array, $slide_text_font_string); } } //is font family defined for slide's subtitle? if(get_post_meta(get_the_ID(), "qode_slide-subtitle-font-family", true) != "") { $slide_subtitle_font_family = get_post_meta(get_the_ID(), "qode_slide-subtitle-font-family", true); $slide_subtitle_font_string = $slide_subtitle_font_family .":".$font_weight_str; if(!in_array($slide_subtitle_font_string, $fonts_array) && !qode_is_native_font($slide_subtitle_font_family)) { //include that font array_push($fonts_array, $slide_subtitle_font_string); } } endwhile; wp_reset_postdata(); $fonts_array = array_diff($fonts_array, array("-1:".$font_weight_str)); $google_fonts_string = implode( '|', $fonts_array); //is google font option checked anywhere in theme? if(count($fonts_array) > 0) { //include all checked fonts printf("\r\n", str_replace(' ', '+', $google_fonts_string)); } else { //include default google font that theme is using printf("\r\n"); } if(isset($qode_toolbar)){ printf("\r\n"); } } add_action('wp_enqueue_scripts', 'qode_google_fonts_styles'); } /* Add js */ if (!function_exists('qode_scripts')) { function qode_scripts() { global $qode_options_proya; global $is_chrome; global $is_opera; global $is_IE; global $qode_toolbar; global $qode_landing; global $qode_tour_popup; global $woocommerce; $smooth_scroll = true; if(isset($qode_options_proya['smooth_scroll']) && $qode_options_proya['smooth_scroll'] == "no"){ $smooth_scroll = false; } wp_enqueue_script("jquery"); wp_enqueue_script("plugins", QODE_ROOT."/js/plugins.js",array(),false,true); wp_enqueue_script("carouFredSel", QODE_ROOT."/js/jquery.carouFredSel-6.2.1.min.js",array(),false,true); wp_enqueue_script("lemmonSlider", QODE_ROOT."/js/lemmon-slider.min.js",array(),false,true); wp_enqueue_script("one_page_scroll", QODE_ROOT."/js/jquery.fullPage.min.js",array(),false,true); wp_enqueue_script("mousewheel", QODE_ROOT."/js/jquery.mousewheel.min.js",array(),false,true); wp_enqueue_script("touchSwipe", QODE_ROOT."/js/jquery.touchSwipe.min.js",array(),false,true); wp_enqueue_script("isotope", QODE_ROOT."/js/jquery.isotope.min.js",array(),false,true); wp_enqueue_script("stretch", QODE_ROOT."/js/jquery.stretch.js",array(),false,true); $mac_os = strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh; Intel Mac OS X"); if($smooth_scroll && $mac_os == false){ wp_enqueue_script("TweenLite", QODE_ROOT."/js/TweenLite.min.js",array(),false,true); if(!qode_layer_slider_installed() || !qode_revolution_slider_installed()){ wp_enqueue_script("ScrollToPlugin", QODE_ROOT."/js/ScrollToPlugin.min.js",array(),false,true); } wp_enqueue_script("smoothPageScroll", QODE_ROOT."/js/smoothPageScroll.min.js",array(),false,true); } if ( $is_IE ) { wp_enqueue_script("html5", QODE_ROOT."/js/html5.js",array(),false,false); } if((isset($qode_options_proya['enable_google_map']) && $qode_options_proya['enable_google_map'] == "yes") || qode_is_ajax_enabled() || qode_has_google_map_shortcode()) : if( (isset($qode_options_proya['google_maps_api_key']) && $qode_options_proya['google_maps_api_key'] != "")) { $google_maps_api_key = $qode_options_proya['google_maps_api_key']; wp_enqueue_script("google_map_api", "https://maps.googleapis.com/maps/api/js?key=" . $google_maps_api_key,array(),false,true); } else { wp_enqueue_script("google_map_api", "https://maps.googleapis.com/maps/api/js",array(),false,true); } endif; if (file_exists(dirname(__FILE__) ."/js/default_dynamic.js") && qode_is_js_folder_writable() && !is_multisite()) { wp_enqueue_script("default_dynamic", QODE_ROOT."/js/default_dynamic.js",array(), filemtime(dirname(__FILE__) ."/js/default_dynamic.js"),true); } else { wp_enqueue_script("default_dynamic", QODE_ROOT."/js/default_dynamic.php",array(),false,true); } wp_enqueue_script("default", QODE_ROOT."/js/default.min.js",array(),false,true); if (file_exists(dirname(__FILE__) ."/js/custom_js.js") && qode_is_js_folder_writable() && !is_multisite()) { wp_enqueue_script("custom_js", QODE_ROOT."/js/custom_js.js",array(), filemtime(dirname(__FILE__) ."/js/custom_js.js"),true); } else { wp_enqueue_script("custom_js", QODE_ROOT."/js/custom_js.php",array(),false,true); } global $wp_scripts; $wp_scripts->add_data('comment-reply', 'group', 1 ); if ( is_singular() ) wp_enqueue_script( "comment-reply"); $has_ajax = false; $qode_animation = ""; if (isset($_SESSION['qode_proya_page_transitions'])) $qode_animation = $_SESSION['qode_proya_page_transitions']; if (($qode_options_proya['page_transitions'] != "0") && (empty($qode_animation) || ($qode_animation != "no"))) $has_ajax = true; elseif (!empty($qode_animation) && ($qode_animation != "no")) $has_ajax = true; if ($has_ajax) : wp_enqueue_script("ajax", QODE_ROOT."/js/ajax.min.js",array(),false,true); endif; wp_enqueue_script( 'wpb_composer_front_js' ); if(isset($qode_options_proya['use_recaptcha']) && $qode_options_proya['use_recaptcha'] == "yes") : wp_enqueue_script("recaptcha_ajax", "http://www.google.com/recaptcha/api/js/recaptcha_ajax.js",array(),false,true); endif; //is toolbar enabled? if(isset($qode_toolbar)) { //include toolbar specific script wp_enqueue_script("qode_toolbar", QODE_ROOT."/js/toolbar.js",array(),false,true); } //is landing enabled? if(isset($qode_landing)) { wp_enqueue_script("mixitup", get_home_url() . "/demo-files/landing/js/jquery.mixitup.js",array(),false,true); wp_enqueue_script("mixitup_pagination", get_home_url() . "/demo-files/landing/js/jquery.mixitup-pagination.js",array(),false,true); wp_enqueue_script("qode_cookie", get_home_url() . "/demo-files/landing/js/js.cookie.js",array(),false,true); wp_enqueue_script("qode_landing", get_home_url() . "/demo-files/landing/js/landing_default.js",array(),false,true); } //is tour popup enabled? if(isset($qode_tour_popup)) { wp_enqueue_script("qode_cookie", get_home_url() . "/demo-files/landing/js/js.cookie.js",array(),false,true); wp_enqueue_script("qode_tour_popup", get_home_url() . "/demo-files/landing/js/tour_popup_default.js",array(),false,true); } if($woocommerce) { wp_enqueue_script("woocommerce-qode", QODE_ROOT."/js/woocommerce.js",array(),false,true); wp_enqueue_script("select2", QODE_ROOT."/js/select2.min.js",array(),false,true); } } add_action('wp_enqueue_scripts', 'qode_scripts'); } /*Because of the bug when Revolution slider, Layer Slider and Smooth Scroll are enabled together (greensock.js doesn't have included ScrollTo so it need to be included before)*/ if(!function_exists('qode_scrollto_script')) { function qode_scrollto_script(){ global $qode_options_proya; $smooth_scroll = true; if(isset($qode_options_proya['smooth_scroll']) && $qode_options_proya['smooth_scroll'] == "no"){ $smooth_scroll = false; } $mac_os = strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh; Intel Mac OS X"); if($smooth_scroll && $mac_os == false && qode_layer_slider_installed() && qode_revolution_slider_installed()) { wp_enqueue_script("ScrollToPlugin", QODE_ROOT . "/js/ScrollToPlugin.min.js", array(), false, false); } } add_action('wp_enqueue_scripts', 'qode_scrollto_script', 1); } if(!function_exists('qode_init_page_id')) { /** * Function that sets global $qode_page_id variable */ function qode_init_page_id() { global $wp_query; global $qode_page_id; $qode_page_id = $wp_query->get_queried_object_id(); } add_action('get_header', 'qode_init_page_id'); } /* Add admin js and css */ if (!function_exists('qode_admin_jquery')) { function qode_admin_jquery() { wp_enqueue_script('jquery'); wp_enqueue_style('style', QODE_ROOT.'/css/admin/admin-style.css', false, '1.0', 'screen'); wp_enqueue_style('colorstyle', QODE_ROOT.'/css/admin/colorpicker.css', false, '1.0', 'screen'); wp_register_script('colorpickerss', QODE_ROOT.'/js/admin/colorpicker.js', array('jquery'), '1.0.0', false ); wp_enqueue_script('colorpickerss'); wp_enqueue_style('thickbox'); wp_enqueue_script('media-upload'); wp_enqueue_media(); wp_enqueue_script('thickbox'); wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_script('jquery-ui-accordion'); wp_register_script('default', QODE_ROOT.'/js/admin/default.js', array('jquery'), '1.0.0', false ); wp_enqueue_script('default'); wp_enqueue_script('common'); wp_enqueue_script('wp-lists'); wp_enqueue_script('postbox'); } } add_action('admin_enqueue_scripts', 'qode_admin_jquery'); if (!isset( $content_width )) $content_width = 1060; /* Register Menus */ if (!function_exists('qode_register_menus')) { /** * Function that registers menu positions */ function qode_register_menus() { global $qode_options_proya; if((isset($qode_options_proya['header_bottom_appearance']) && $qode_options_proya['header_bottom_appearance'] != "stick_with_left_right_menu") || (isset($qode_options_proya['vertical_area']) && $qode_options_proya['vertical_area'] == "yes")){ //header and left menu location register_nav_menus( array('top-navigation' => __( 'Top Navigation', 'qode') ) ); } //popup menu location register_nav_menus( array('popup-navigation' => __( 'Fullscreen Navigation', 'qode') ) ); if((isset($qode_options_proya['header_bottom_appearance']) && $qode_options_proya['header_bottom_appearance'] == "stick_with_left_right_menu") && (isset($qode_options_proya['vertical_area']) && $qode_options_proya['vertical_area'] == "no")){ //header left menu location register_nav_menus( array('left-top-navigation' => __( 'Left Top Navigation', 'qode') ) ); //header right menu location register_nav_menus( array('right-top-navigation' => __( 'Right Top Navigation', 'qode') ) ); } } add_action( 'after_setup_theme', 'qode_register_menus' ); } if(!function_exists('qode_theme_setup')) { /** * Function that adds various features to theme. Also defines image sizes that are used in a theme */ function qode_theme_setup() { //add post formats support add_theme_support('post-formats', array('gallery', 'link', 'quote', 'video', 'audio')); //add feedlinks support add_theme_support( 'automatic-feed-links' ); //add theme support for post thumbnails add_theme_support( 'post-thumbnails' ); add_image_size( 'portfolio-square', 570, 570, true ); add_image_size( 'portfolio-portrait', 600, 800, true ); add_image_size( 'portfolio-landscape', 800, 600, true ); add_image_size( 'menu-featured-post', 345, 198, true ); add_image_size( 'qode-carousel_slider', 400, 260, true ); add_image_size( 'portfolio_slider', 500, 380, true ); add_image_size( 'portfolio_masonry_regular', 500, 500, true ); add_image_size( 'portfolio_masonry_wide', 1000, 500, true ); add_image_size( 'portfolio_masonry_tall', 500, 1000, true ); add_image_size( 'portfolio_masonry_large', 1000, 1000, true ); add_image_size( 'portfolio_masonry_with_space', 700); add_image_size( 'latest_post_boxes', 539, 303, true ); //enable rendering shortcodes in widgets add_filter('widget_text', 'do_shortcode'); //enable rendering shortcodes in post excerpt //add_filter( 'the_excerpt', 'do_shortcode'); //enable rendering shortcodes in call to action add_filter( 'call_to_action_widget', 'do_shortcode'); load_theme_textdomain( 'qode', get_template_directory().'/languages' ); } add_action('after_setup_theme', 'qode_theme_setup'); } if (!function_exists('ajax_classes')) { /** * Function that adds classes for ajax animation on body element * @param $classes array of current body classes * @return array array of changed body classes */ function ajax_classes($classes) { global $qode_options_proya; $qode_animation=""; if (isset($_SESSION['qode_animation'])) $qode_animation = $_SESSION['qode_animation']; if(($qode_options_proya['page_transitions'] === "0") && ($qode_animation == "no")) : $classes[] = ''; elseif($qode_options_proya['page_transitions'] === "1" && (empty($qode_animation) || ($qode_animation != "no"))) : $classes[] = 'ajax_updown'; $classes[] = 'page_not_loaded'; elseif($qode_options_proya['page_transitions'] === "2" && (empty($qode_animation) || ($qode_animation != "no"))) : $classes[] = 'ajax_fade'; $classes[] = 'page_not_loaded'; elseif($qode_options_proya['page_transitions'] === "3" && (empty($qode_animation) || ($qode_animation != "no"))) : $classes[] = 'ajax_updown_fade'; $classes[] = 'page_not_loaded'; elseif($qode_options_proya['page_transitions'] === "4" && (empty($qode_animation) || ($qode_animation != "no"))) : $classes[] = 'ajax_leftright'; $classes[] = 'page_not_loaded'; elseif(!empty($qode_animation) && $qode_animation != "no") : $classes[] = 'page_not_loaded'; else: $classes[] =""; endif; return $classes; } add_filter('body_class','ajax_classes'); } /* Add class on body boxed layout */ if (!function_exists('boxed_class')) { /** * Function that adds class on body for boxed layout * @param $classes array of current body classes * @return array array of changed body classes */ function boxed_class($classes) { global $qode_options_proya; if(isset($qode_options_proya['boxed']) && $qode_options_proya['boxed'] == "yes" && isset($qode_options_proya['transparent_content']) && $qode_options_proya['transparent_content'] == 'no') : $classes[] = 'boxed'; else: $classes[] =""; endif; return $classes; } add_filter('body_class','boxed_class'); } /* Add class on body for vertical menu */ if (!function_exists('vertical_menu_class')) { /** * Function that adds classes on body element for vertical menu * @param $classes array of current body classes * @return array array of changed body classes */ function vertical_menu_class($classes) { global $qode_options_proya; global $wp_query; if(isset($qode_options_proya['vertical_area']) && $qode_options_proya['vertical_area'] =='yes') { $classes[] = 'vertical_menu_enabled'; //left menu type class? if(isset($qode_options_proya['vertical_area_type']) && $qode_options_proya['vertical_area_type'] != '') { switch ($qode_options_proya['vertical_area_type']) { case 'hidden': $classes[] = ' vertical_menu_hidden'; if(isset($qode_options_proya['vertical_logo_bottom']) && $qode_options_proya['vertical_logo_bottom'] !== '') { $classes[] = 'vertical_menu_hidden_with_logo'; } break; } } if(isset($qode_options_proya['vertical_area_type']) && $qode_options_proya['vertical_area_type'] =='hidden') { if(isset($qode_options_proya['vertical_area_width']) && $qode_options_proya['vertical_area_width']=='width_290'){ $classes[] = ' vertical_menu_width_290'; } elseif(isset($qode_options_proya['vertical_area_width']) && $qode_options_proya['vertical_area_width']=='width_350'){ $classes[] = ' vertical_menu_width_350'; } elseif(isset($qode_options_proya['vertical_area_width']) && $qode_options_proya['vertical_area_width']=='width_400'){ $classes[] = ' vertical_menu_width_400'; } else{ $classes[] = ' vertical_menu_width_260'; } } } $id = $wp_query->get_queried_object_id(); if(qode_is_woocommerce_page()) { $id = get_option('woocommerce_shop_page_id'); } if(isset($qode_options_proya['vertical_area_transparency']) && $qode_options_proya['vertical_area_transparency'] =='yes' && get_post_meta($id, "qode_page_vertical_area_transparency", true) != "no"){ $classes[] = ' vertical_menu_transparency vertical_menu_transparency_on'; }else if(get_post_meta($id, "qode_page_vertical_area_transparency", true) == "yes"){ $classes[] = ' vertical_menu_transparency vertical_menu_transparency_on'; } return $classes; } add_filter('body_class','vertical_menu_class'); } if (!function_exists('elements_animation_on_touch_class')) { /** * Function that adds classes on body element for disabled animations on touch devices * @param $classes array of current body classes * @return array array of changed body classes */ function elements_animation_on_touch_class($classes) { global $qode_options_proya; $isMobile = (bool)preg_match('#\b(ip(hone|od|ad)|android|opera m(ob|in)i|windows (phone|ce)|blackberry|tablet'. '|s(ymbian|eries60|amsung)|p(laybook|alm|rofile/midp|laystation portable)|nokia|fennec|htc[\-_]'. '|mobile|up\.browser|[1-4][0-9]{2}x[1-4][0-9]{2})\b#i', $_SERVER['HTTP_USER_AGENT'] ); if(isset($qode_options_proya['elements_animation_on_touch']) && $qode_options_proya['elements_animation_on_touch'] == "no" && $isMobile == true) : $classes[] = 'no_animation_on_touch'; else: $classes[] =""; endif; return $classes; } add_filter('body_class','elements_animation_on_touch_class'); } /* Add class on body for content negative margin */ if (!function_exists('content_negative_margin')) { /** * Function that adds classes on body element for negative margin for content * @param $classes array of current body classes * @return array array of changed body classes */ function content_negative_margin($classes) { global $qode_options_proya; if(isset($qode_options_proya['vertical_area']) && $qode_options_proya['vertical_area'] =='no' && isset($qode_options_proya['move_content_up']) && $qode_options_proya['move_content_up'] == 'yes'){ $classes[] = 'content_top_margin'; } return $classes; } add_filter('body_class','content_negative_margin'); } if(!function_exists('qode_hidden_title_body_class')) { /** * Function that adds class to body element if title is hidden for current page * @param $classes array of currently added classes for body element * @return array array of modified classes */ function qode_hidden_title_body_class($classes) { $page_id = qode_get_page_id(); if($page_id) { if(qode_is_title_hidden()) { $classes[] = 'qode-title-hidden'; } } return $classes; } add_filter('body_class', 'qode_hidden_title_body_class'); } if(!function_exists('qode_paspartu_body_class')) { /** * Function that adds paspartu class to body. * @param $classes array of body classes * @return array with paspartu body class added */ function qode_paspartu_body_class($classes) { global $qode_options_proya; if(isset($qode_options_proya['paspartu']) && $qode_options_proya['paspartu'] == 'yes') { $classes[] = 'paspartu_enabled'; if((isset($qode_options_proya['paspartu_on_top']) && $qode_options_proya['paspartu_on_top'] == 'yes' && isset($qode_options_proya['paspartu_on_top_fixed']) && $qode_options_proya['paspartu_on_top_fixed'] == 'yes') || (isset($qode_options_proya['vertical_area']) && $qode_options_proya['vertical_area'] == "yes" && isset($qode_options_proya['vertical_menu_inside_paspartu']) && $qode_options_proya['vertical_menu_inside_paspartu'] == 'yes')) { $classes[] = 'paspartu_on_top_fixed'; } if((isset($qode_options_proya['paspartu_on_bottom']) && $qode_options_proya['paspartu_on_bottom'] == 'yes' && isset($qode_options_proya['paspartu_on_bottom_fixed']) && $qode_options_proya['paspartu_on_bottom_fixed'] == 'yes') || (isset($qode_options_proya['vertical_area']) && $qode_options_proya['vertical_area'] == "yes" && isset($qode_options_proya['vertical_menu_inside_paspartu']) && $qode_options_proya['vertical_menu_inside_paspartu'] == 'yes')) { $classes[] = 'paspartu_on_bottom_fixed'; } if(isset($qode_options_proya['vertical_area']) && $qode_options_proya['vertical_area'] == "yes" && isset($qode_options_proya['vertical_menu_inside_paspartu']) && $qode_options_proya['vertical_menu_inside_paspartu'] == 'no') { $classes[] = 'vertical_menu_outside_paspartu'; } if(isset($qode_options_proya['vertical_area']) && $qode_options_proya['vertical_area'] == "yes" && isset($qode_options_proya['vertical_menu_inside_paspartu']) && $qode_options_proya['vertical_menu_inside_paspartu'] == 'yes') { $classes[] = 'vertical_menu_inside_paspartu'; } } return $classes; } add_filter('body_class', 'qode_paspartu_body_class'); } /* Add class on body depending on content width */ if (!function_exists('qode_content_width_class')) { /** * Function that adds class on body depending on content width * @param $classes array of current body classes * @return array array of changed body classes */ function qode_content_width_class($classes){ global $qode_options_proya; $classes[] = ""; if (isset($qode_options_proya['initial_content_width']) && $qode_options_proya['initial_content_width'] !== "grid_1100") { $classes[] = 'qode_' . $qode_options_proya['initial_content_width']; } return $classes; } add_filter('body_class','qode_content_width_class'); } if(!function_exists('qode_side_menu_body_class')) { /** * Function that adds body classes for different side menu styles * @param $classes array original array of body classes * @return array modified array of classes */ function qode_side_menu_body_class($classes) { global $qode_options_proya; if(isset($qode_options_proya['enable_side_area']) && $qode_options_proya['enable_side_area'] == 'yes') { if(isset($qode_options_proya['side_area_type']) && $qode_options_proya['side_area_type'] == 'side_menu_slide_from_right') { $classes[] = 'side_menu_slide_from_right'; } else if(isset($qode_options_proya['side_area_type']) && $qode_options_proya['side_area_type'] == 'side_menu_slide_with_content') { $classes[] = 'side_menu_slide_with_content'; $classes[] = $qode_options_proya['side_area_slide_with_content_width']; } else { $classes[] = 'side_area_uncovered_from_content'; } } return $classes; } add_filter('body_class', 'qode_side_menu_body_class'); } if(!function_exists('qode_full_screen_menu_body_class')) { /** * Function that adds body classes for different full screen menu types * @param $classes array original array of body classes * @return array modified array of classes */ function qode_full_screen_menu_body_class($classes) { global $qode_options_proya; if(isset($qode_options_proya['enable_popup_menu']) && $qode_options_proya['enable_popup_menu'] == 'yes') { if(isset($qode_options_proya['popup_menu_animation_style']) && !empty($qode_options_proya['popup_menu_animation_style'])) { $classes[] = 'qode_' . $qode_options_proya['popup_menu_animation_style']; } } return $classes; } add_filter('body_class', 'qode_full_screen_menu_body_class'); } if(!function_exists('qode_overlapping_content_body_class')) { /** * Function that adds transparent content class to body. * @param $classes array of body classes * @return array with transparent content body class added */ function qode_overlapping_content_body_class($classes) { global $qode_options_proya; if(isset($qode_options_proya['overlapping_content']) && $qode_options_proya['overlapping_content'] == 'yes') { $classes[] = 'overlapping_content'; } return $classes; } add_filter('body_class', 'qode_overlapping_content_body_class'); } if(!function_exists('qode_vss_responsive_body_class')) { /** * Function that adds vertical split slider responsive class to body. * @param $classes array of body classes * @return array with vertical split slider responsive body class added */ function qode_vss_responsive_body_class($classes) { global $qode_options_proya; if(isset($qode_options_proya['vss_responsive_advanced']) && $qode_options_proya['vss_responsive_advanced'] == 'yes') { $classes[] = 'vss_responsive_adv'; } return $classes; } add_filter('body_class', 'qode_vss_responsive_body_class'); } if(!function_exists('qode_footer_responsive_body_class')) { /** * Function that adds footer responsive class to body. * @param $classes array of body classes */ function qode_footer_responsive_body_class($classes) { global $qode_options_proya; if(isset($qode_options_proya['footer_top_responsive']) && $qode_options_proya['footer_top_responsive'] === 'yes') { $classes[] = 'footer_responsive_adv'; } return $classes; } add_filter('body_class', 'qode_footer_responsive_body_class'); } if(!function_exists('qode_top_header_responsive_body_class')) { function qode_top_header_responsive_body_class($classes) { global $qode_options_proya; if(isset($qode_options_proya['hide_top_bar_on_mobile']) && $qode_options_proya['hide_top_bar_on_mobile'] === 'yes') { $classes[] = 'hide_top_bar_on_mobile_header'; } return $classes; } add_filter('body_class', 'qode_top_header_responsive_body_class'); } if(!function_exists('qode_content_sidebar_responsive_body_class')) { function qode_content_sidebar_responsive_body_class($classes) { global $qode_options_proya; if(isset($qode_options_proya['content_sidebar_responsiveness']) && $qode_options_proya['content_sidebar_responsiveness'] === 'yes') { $classes[] = 'qode-content-sidebar-responsive'; } return $classes; } add_filter('body_class', 'qode_content_sidebar_responsive_body_class'); } if(!function_exists('qode_transparent_content_body_class')) { /** * Function that adds transparent content class to body. * @param $classes array of body classes * @return array with transparent content body class added */ function qode_transparent_content_body_class($classes) { global $qode_options_proya; if(isset($qode_options_proya['transparent_content']) && $qode_options_proya['transparent_content'] == 'yes') { $classes[] = 'transparent_content'; } return $classes; } add_filter('body_class', 'qode_transparent_content_body_class'); } if(!function_exists('qode_is_title_hidden')) { /** * Function that check is title hidden on current page * @param none * @return true/false */ function qode_is_title_hidden() { global $qode_options_proya; $page_id = qode_get_page_id(); $hide_page_title_area = false; if(get_post_meta($page_id, "qode_show-page-title", true) === 'yes'){ $hide_page_title_area = true; }elseif(get_post_meta($page_id, "qode_show-page-title", true) === 'no'){ $hide_page_title_area = false; }else{ if(isset($qode_options_proya['dont_show_page_title']) && ($qode_options_proya['dont_show_page_title'] === 'yes')){ $hide_page_title_area = true; }elseif(isset($qode_options_proya['dont_show_page_title']) && ($qode_options_proya['dont_show_page_title'] === 'no')){ $hide_page_title_area = false; } } return $hide_page_title_area; } } if(!function_exists('qode_is_title_text_hidden')) { /** * Function that check is title text hidden on current page * @param none * @return true/false */ function qode_is_title_text_hidden() { global $qode_options_proya; $page_id = qode_get_page_id(); $hide_page_title_text = false; if(get_post_meta($page_id, "qode_show-page-title-text", true) === 'yes'){ $hide_page_title_text = true; }elseif(get_post_meta($page_id, "qode_show-page-title-text", true) === 'no'){ $hide_page_title_text = false; }else{ if(isset($qode_options_proya['dont_show_page_title_text']) && ($qode_options_proya['dont_show_page_title_text'] === 'yes')){ $hide_page_title_text = true; }elseif(isset($qode_options_proya['dont_show_page_title_text']) && ($qode_options_proya['dont_show_page_title_text'] === 'no')){ $hide_page_title_text = false; } } return $hide_page_title_text; } } if(!function_exists('qode_is_content_below_header')) { /** * Function that check is content below header on page * @param none * @return true/false */ function qode_is_content_below_header() { global $qode_options_proya; $page_id = qode_get_page_id(); $content_below_header = false; if(get_post_meta($page_id, "qode_enable_content_top_margin", true) === 'yes'){ $content_below_header = true; }elseif(get_post_meta($page_id, "qode_enable_content_top_margin", true) === 'no'){ $content_below_header = false; }else{ if(isset($qode_options_proya['enable_content_top_margin']) && ($qode_options_proya['enable_content_top_margin'] === 'yes')){ $content_below_header = true; }elseif(isset($qode_options_proya['enable_content_top_margin']) && ($qode_options_proya['enable_content_top_margin'] === 'no')){ $content_below_header = false; } } return $content_below_header; } } /* Excerpt more */ if (!function_exists('qode_excerpt_more')) { /** * Function that adds three dots on excerpt * @param $more string current more string * @return string changed more string */ function qode_excerpt_more( $more ) { return '...'; } add_filter('excerpt_more', 'qode_excerpt_more'); } if (!function_exists('qode_excerpt_length')) { /** * Function that changes excerpt length based on theme options * @param $length int original value * @return int changed value */ function qode_excerpt_length( $length ) { global $qode_options_proya; if($qode_options_proya['number_of_chars']){ return $qode_options_proya['number_of_chars']; } else { return 45; } } add_filter( 'excerpt_length', 'qode_excerpt_length', 999 ); } if (!function_exists('the_excerpt_max_charlength')) { /** * Function that sets character length for social share shortcode * @param $charlength string original text * @return string shortened text */ function the_excerpt_max_charlength($charlength) { global $qode_options_proya; if(isset($qode_options_proya['twitter_via']) && !empty($qode_options_proya['twitter_via'])) { $via = " via " . $qode_options_proya['twitter_via'] . " "; } else { $via = ""; } $excerpt = get_the_excerpt(); $charlength = 140 - (mb_strlen($via) + $charlength); if ( mb_strlen( $excerpt ) > $charlength ) { $subex = mb_substr( $excerpt, 0, $charlength); $exwords = explode( ' ', $subex ); $excut = - ( mb_strlen( $exwords[ count( $exwords ) - 1 ] ) ); if ( $excut < 0 ) { return mb_substr( $subex, 0, $excut ); } else { return $subex; } } else { return $excerpt; } } } if(!function_exists('qode_excerpt')) { /** * Function that cuts post excerpt to the number of word based on previosly set global * variable $word_count, which is defined in qode_set_blog_word_count function. * * It current post has read more tag set it will return content of the post, else it will return post excerpt * * @changed in 4.3 version */ function qode_excerpt() { global $qode_options_proya, $word_count, $post; //does current post has read more tag set? if(qode_post_has_read_more()) { global $more; //override global $more variable so this can be used in blog templates $more = 0; echo get_the_content(''); } //is word count set to something different that 0? elseif($word_count != '0') { //if word count is set and different than empty take that value, else that general option from theme options $word_count = isset($word_count) && $word_count !== "" ? $word_count : $qode_options_proya['number_of_chars']; //if post excerpt field is filled take that as post excerpt, else that content of the post $post_excerpt = $post->post_excerpt != "" ? $post->post_excerpt : strip_tags($post->post_content); //remove leading dots if those exists $clean_excerpt = strlen($post_excerpt) && strpos($post_excerpt, '...') ? strstr($post_excerpt, '...', true) : $post_excerpt; //if clean excerpt has text left if($clean_excerpt !== '') { //explode current excerpt to words $excerpt_word_array = explode (' ', $clean_excerpt); //cut down that array based on the number of the words option $excerpt_word_array = array_slice ($excerpt_word_array, 0, $word_count); //add exerpt postfix $excert_postfix = apply_filters('qode_excerpt_postfix', '...'); //and finally implode words together $excerpt = implode (' ', $excerpt_word_array).$excert_postfix; //is excerpt different than empty string? if($excerpt !== '') { echo '

'.$excerpt.'

'; } } } } } if(!function_exists('qode_set_blog_word_count')) { /** * Function that sets global blog word count variable used by qode_excerpt function */ function qode_set_blog_word_count($word_count_param) { global $word_count; $word_count = $word_count_param; } } /* Use slider instead of image for post */ if (!function_exists('slider_blog')) { function slider_blog($post_id) { $sliders = get_post_meta($post_id, "qode_sliders", true); $slider = $sliders[1]; if($slider) { $html = ""; $html .= '