get_queried_object_id(); // Enqueue catchevolution Sytlesheet wp_enqueue_style( 'catchevolution_style', get_stylesheet_uri() ); // Register JQuery cycle all and JQuery set up as dependent on Jquery-cycle wp_register_script( 'jquery-cycle', get_template_directory_uri() . '/js/jquery.cycle.all.min.js', array( 'jquery' ), '2.9999.5', true ); // Slider JS load loop if ( ( $enableslider == 'enable-slider-allpage' ) || ( ( is_front_page() || ( is_home() && $page_id != $page_for_posts ) ) && $enableslider == 'enable-slider-homepage' ) ) { wp_enqueue_script( 'catchevolution-slider', get_template_directory_uri() . '/js/catchevolution.slider.js', array( 'jquery-cycle' ), '1.0', true ); } //Responsive wp_enqueue_script('catchevolution-menu', get_template_directory_uri() . '/js/catchevolution-menu.min.js', array('jquery'), '1.1.0', true); wp_enqueue_style( 'catchevolution-responsive', get_template_directory_uri() . '/css/responsive.css' ); wp_enqueue_script( 'catchevolution-fitvids', get_template_directory_uri() . '/js/catchevolution-fitvids.min.js', array( 'jquery' ), '20130324', true ); /** * Adds JavaScript to pages with the comment form to support * sites with threaded comments (when in use). */ if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } //Browser Specific Enqueue Script i.e. for IE 1-6 $catchevolution_ua = strtolower($_SERVER['HTTP_USER_AGENT']); if(preg_match('/(?i)msie [1-6]/',$catchevolution_ua)) { wp_enqueue_script( 'catchevolution-pngfix', get_template_directory_uri() . '/js/pngfix.min.js' ); } //browser specific queuing i.e. for IE 1-8 if(preg_match('/(?i)msie [1-8]/',$catchevolution_ua)) { wp_enqueue_script( 'catchevolution-ieltc8', get_template_directory_uri() . '/js/catchevolution-ielte8.min.js', array( 'jquery' ), '20130114', false ); wp_enqueue_style( 'catchevolution-iecss', get_template_directory_uri() . '/css/ie.css' ); } } // catchevolution_scripts_method add_action( 'wp_enqueue_scripts', 'catchevolution_scripts_method' ); /** * Register script for admin section * * No scripts should be enqueued within this function. * jquery cookie used for remembering admin tabs, and potential future features... so let's register it early * @uses wp_register_script * @action admin_enqueue_scripts */ function catchevolution_register_js() { //jQuery Cookie wp_register_script( 'jquery-cookie', get_template_directory_uri() . '/js/jquery.cookie.min.js', array( 'jquery' ), '1.0', true ); } add_action( 'admin_enqueue_scripts', 'catchevolution_register_js' ); /** * Responsive Layout * * @get the data value of responsive layout from theme options * @display responsive meta tag * @action wp_head */ function catchevolution_responsive() { echo ''; } // catchevolution_responsive add_filter( 'wp_head', 'catchevolution_responsive', 1 ); /** * Get the favicon Image from theme options * * @uses favicon * @get the data value of image from theme options * @display favicon * * @uses default favicon if favicon field on theme options is empty * * @uses set_transient and delete_transient */ function catchevolution_favicon() { //delete_transient( 'catchevolution_favicon' ); if( ( !$catchevolution_favicon = get_transient( 'catchevolution_favicon' ) ) ) { global $catchevolution_options_settings; $options = $catchevolution_options_settings; echo ''; if ( empty( $options[ 'remove_favicon' ] ) ) : // if not empty fav_icon on theme options if ( !empty( $options[ 'fav_icon' ] ) ) : $catchevolution_favicon = ''; else: // if empty fav_icon on theme options, display default fav icon $catchevolution_favicon = ''; endif; endif; set_transient( 'catchevolution_favicon', $catchevolution_favicon, 86940 ); } echo $catchevolution_favicon ; } // catchevolution_favicon //Load Favicon in Header Section add_action('wp_head', 'catchevolution_favicon'); //Load Favicon in Admin Section add_action( 'admin_head', 'catchevolution_favicon' ); /** * Enqueue the styles for the current color scheme. * * @since Catch Evolution 1.0 */ function catchevolution_enqueue_color_scheme() { global $catchevolution_options_settings; $options = $catchevolution_options_settings; $color_scheme = $options['color_scheme']; if ( 'dark' == $color_scheme ) wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null ); do_action( 'catchevolution_enqueue_color_scheme', $color_scheme ); } add_action( 'wp_enqueue_scripts', 'catchevolution_enqueue_color_scheme' ); /** * Hooks the Custom Inline CSS to head section * * @since Catch Evolution Pro 1.0 */ function catchevolution_inline_css() { //delete_transient( 'catchevolution_inline_css' ); global $catchevolution_options_settings, $catchevolution_options_defaults; $options = $catchevolution_options_settings; $defaults = $catchevolution_options_defaults; if ( ( !$catchevolution_inline_css = get_transient( 'catchevolution_inline_css' ) ) && ( !empty( $options[ 'disable_header' ] ) || !empty( $options[ 'custom_css' ] ) ) ) { echo '' . "\n"; $catchevolution_inline_css = '' . "\n"; $catchevolution_inline_css .= '' . "\n"; set_transient( 'catchevolution_inline_css', $catchevolution_inline_css, 86940 ); } echo $catchevolution_inline_css; } add_action('wp_head', 'catchevolution_inline_css'); /** * Sets the post excerpt length. * * To override this length in a child theme, remove the filter and add your own * function tied to the excerpt_length filter hook. */ function catchevolution_excerpt_length( $length ) { global $catchevolution_options_settings; $options = $catchevolution_options_settings; if( empty( $options['excerpt_length'] ) ) $options = catchevolution_get_default_theme_options(); $length = $options['excerpt_length']; return $length; } add_filter( 'excerpt_length', 'catchevolution_excerpt_length' ); /** * Returns a "Continue Reading" link for excerpts */ function catchevolution_continue_reading_link() { global $catchevolution_options_settings; $options = $catchevolution_options_settings; $more_tag_text = $options[ 'more_tag_text' ]; return ' ' . sprintf( __( '%s', 'catch-evolution' ), esc_attr( $more_tag_text ) ) . ''; } /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and catchevolution_continue_reading_link(). * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. */ function catchevolution_auto_excerpt_more( $more ) { return catchevolution_continue_reading_link(); } add_filter( 'excerpt_more', 'catchevolution_auto_excerpt_more' ); /** * Adds a pretty "Continue Reading" link to custom post excerpts. * * To override this link in a child theme, remove the filter and add your own * function tied to the get_the_excerpt filter hook. */ function catchevolution_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= catchevolution_continue_reading_link(); } return $output; } add_filter( 'get_the_excerpt', 'catchevolution_custom_excerpt_more' ); if ( ! function_exists( 'catchevolution_content_nav' ) ) : /** * Display navigation to next/previous pages when applicable */ function catchevolution_content_nav( $nav_id ) { global $wp_query; /** * Check Jetpack Infinite Scroll * if it's active then disable pagination */ if ( class_exists( 'Jetpack', false ) ) { $jetpack_active_modules = get_option('jetpack_active_modules'); if ( $jetpack_active_modules && in_array( 'infinite-scroll', $jetpack_active_modules ) ) { return false; } } $nav_class = 'site-navigation paging-navigation'; if ( is_single() ) $nav_class = 'site-navigation post-navigation'; if ( $wp_query->max_num_pages > 1 ) { ?> ]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) return false; return esc_url_raw( $matches[1] ); } if ( ! function_exists( 'catchevolution_footer_sidebar_class' ) ) : /** * Count the number of footer sidebars to enable dynamic classes for the footer */ function catchevolution_footer_sidebar_class() { $count = 0; if ( is_active_sidebar( 'sidebar-2' ) ) $count++; if ( is_active_sidebar( 'sidebar-3' ) ) $count++; if ( is_active_sidebar( 'sidebar-4' ) ) $count++; $class = ''; switch ( $count ) { case '1': $class = 'one'; break; case '2': $class = 'two'; break; case '3': $class = 'three'; break; } if ( $class ) echo 'class="' . $class . '"'; } endif; // catchevolution_footer_sidebar_class if ( ! function_exists( 'catchevolution_comment' ) ) : /** * Template for comments and pingbacks. * * To override this walker in a child theme without modifying the comments template * simply create your own catchevolution_comment(), and that function will be used instead. * * Used as a callback by wp_list_comments() for displaying the comments. * * @since Catch Evolution 1.0 */ function catchevolution_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?>
', '' ); ?>
' . ( $req ? '*' : '' ) . '
'; return $fields; } endif; //catchevolution_comment_form_fields add_filter( 'comment_form_default_fields', 'catchevolution_comment_form_fields' ); /** * Redirect WordPress Feeds To FeedBurner */ function catchevolution_rss_redirect() { global $catchevolution_options_settings; $options = $catchevolution_options_settings; if ($options['feed_url']) { $url = 'Location: '.$options['feed_url']; if ( is_feed() && !preg_match('/feedburner|feedvalidator/i', $_SERVER['HTTP_USER_AGENT'])) { header($url); header('HTTP/1.1 302 Temporary Redirect'); } } } add_action('template_redirect', 'catchevolution_rss_redirect'); /** * shows footer content */ function catchevolution_footer_content() { //delete_transient( 'catchevolution_footer_content_new' ); if ( ( !$catchevolution_footer_content = get_transient( 'catchevolution_footer_content_new' ) ) ) { echo ''; $catchevolution_footer_content = catchevolution_assets(); set_transient( 'catchevolution_footer_content_new', $catchevolution_footer_content, 86940 ); } echo $catchevolution_footer_content; } add_action( 'catchevolution_site_generator', 'catchevolution_footer_content', 15 ); if ( ! function_exists( 'catchevolution_social_networks' ) ) : /** * This function for social links display * * @fetch links through Theme Options * @use in widget * @social links, Facebook, Twitter and RSS */ function catchevolution_social_networks() { //delete_transient( 'catchevolution_social_networks' ); // get the data value from theme options global $catchevolution_options_settings; $options = $catchevolution_options_settings; $elements = array(); $elements = array( $options[ 'social_facebook' ], $options[ 'social_twitter' ], $options[ 'social_googleplus' ], $options[ 'social_linkedin' ], $options[ 'social_pinterest' ], $options[ 'social_youtube' ], $options[ 'social_vimeo' ], $options[ 'social_aim' ], $options[ 'social_myspace' ], $options[ 'social_flickr' ], $options[ 'social_tumblr' ], $options[ 'social_deviantart' ], $options[ 'social_dribbble' ], $options[ 'social_myspace' ], $options[ 'social_wordpress' ], $options[ 'social_rss' ], $options[ 'social_slideshare' ], $options[ 'social_instagram' ], $options[ 'social_skype' ], $options[ 'social_soundcloud' ], $options[ 'social_email' ], $options[ 'social_contact' ], $options[ 'social_xing' ], $options[ 'social_meetup' ] ); $flag = 0; if( !empty( $elements ) ) { foreach( $elements as $option) { if( !empty( $option ) ) { $flag = 1; } else { $flag = 0; } if( $flag == 1 ) { break; } } } if ( ( !$catchevolution_social_networks = get_transient( 'catchevolution_social_networks' ) ) && ( $flag == 1 ) ) { echo ''; $catchevolution_social_networks .=' '; set_transient( 'catchevolution_social_networks', $catchevolution_social_networks, 86940 ); } echo $catchevolution_social_networks; } endif; //catchevolution_social_networks /** * Footer Social Icons * */ function catchevolution_footer_social() { global $catchevolution_options_settings; $options = $catchevolution_options_settings; if ( !empty( $options[ 'disable_footer_social' ] ) ) : return catchevolution_social_networks(); endif; } add_action( 'catchevolution_site_generator', 'catchevolution_footer_social', 10 ); if ( ! function_exists( 'catchevolution_social_search' ) ) : /** * This function for social links display * * @fetch links through Theme Options * @use in widget * @social links, Facebook, Twitter and RSS */ function catchevolution_social_search() { //delete_transient( 'catchevolution_social_search' ); // get the data value from theme options global $catchevolution_options_settings; $options = $catchevolution_options_settings; $elements = array(); $elements = array( $options[ 'social_facebook' ], $options[ 'social_twitter' ], $options[ 'social_googleplus' ], $options[ 'social_linkedin' ], $options[ 'social_pinterest' ], $options[ 'social_youtube' ], $options[ 'social_vimeo' ], $options[ 'social_aim' ], $options[ 'social_myspace' ], $options[ 'social_flickr' ], $options[ 'social_tumblr' ], $options[ 'social_deviantart' ], $options[ 'social_dribbble' ], $options[ 'social_myspace' ], $options[ 'social_wordpress' ], $options[ 'social_rss' ], $options[ 'social_slideshare' ], $options[ 'social_instagram' ], $options[ 'social_skype' ], $options[ 'social_soundcloud' ], $options[ 'social_email' ], $options[ 'social_contact' ], $options[ 'social_xing' ], $options[ 'social_meetup' ] ); $flag = 0; if( !empty( $elements ) ) { foreach( $elements as $option) { if( !empty( $option ) ) { $flag = 1; } else { $flag = 0; } if( $flag == 1 ) { break; } } } if ( ( !$catchevolution_social_search = get_transient( 'catchevolution_social_search' ) ) && ( $flag == 1 ) ) { echo ''; $catchevolution_social_search .=' '; set_transient( 'catchevolution_social_search', $catchevolution_social_search, 86940 ); } echo $catchevolution_social_search; } endif; //catchevolution_social_search /** * Site Verification and Webmaster Tools * * If user sets the code we're going to display meta verification * @get the data value from theme options * @uses wp_head action to add the code in the header * @uses set_transient and delete_transient API for cache */ function catchevolution_site_verification() { //delete_transient( 'catchevolution_site_verification' ); if ( ( !$catchevolution_site_verification = get_transient( 'catchevolution_site_verification' ) ) ) { // get the data value from theme options global $catchevolution_options_settings; $options = $catchevolution_options_settings; echo ''; $catchevolution_site_verification = ''; //site stats, analytics header code if ( !empty( $options['analytic_header'] ) ) { $catchevolution_site_verification .= $options[ 'analytic_header' ] ; } set_transient( 'catchevolution_site_verification', $catchevolution_site_verification, 86940 ); } echo $catchevolution_site_verification; } add_action('wp_head', 'catchevolution_site_verification'); /** * This function loads the Footer Code such as Add this code from the Theme Option * * @get the data value from theme options * @load on the footer ONLY * @uses wp_footer action to add the code in the footer * @uses set_transient and delete_transient */ function catchevolution_footercode() { //delete_transient( 'catchevolution_footercode' ); if ( ( !$catchevolution_footercode = get_transient( 'catchevolution_footercode' ) ) ) { // get the data value from theme options global $catchevolution_options_settings; $options = $catchevolution_options_settings; echo ''; //site stats, analytics header code if ( !empty( $options['analytic_footer'] ) ) { $catchevolution_footercode = $options[ 'analytic_footer' ] ; } set_transient( 'catchevolution_footercode', $catchevolution_footercode, 86940 ); } echo $catchevolution_footercode; } add_action('wp_footer', 'catchevolution_footercode'); /** * Get the Web Clip Icon Image from theme options * * @uses web_clip and remove_web_clip * @get the data value of image from theme options * @display favicon * * @uses default Web Click Icon if web_clip field on theme options is empty * * @uses set_transient and delete_transient */ function catchevolution_web_clip() { //delete_transient( 'catchevolution_web_clip' ); if( ( !$catchevolution_web_clip = get_transient( 'catchevolution_web_clip' ) ) ) { global $catchevolution_options_settings; $options = $catchevolution_options_settings; //echo ''; if ( empty( $options[ 'remove_web_clip' ] ) ) : // if not empty fav_icon on theme options if ( !empty( $options[ 'web_clip' ] ) ) : $catchevolution_web_clip = ''; else: // if empty fav_icon on theme options, display default fav icon $catchevolution_web_clip = ''; endif; endif; set_transient( 'catchevolution_web_clip', $catchevolution_web_clip, 86940 ); } echo $catchevolution_web_clip ; } // catchevolution_web_clip //Load WebClip in Header Section add_action('wp_head', 'catchevolution_web_clip'); if ( ! function_exists( 'catchevolution_footer_menu' ) ) : /** * Footer Menu * * @Hooked in catchevolution_after_footer_sidebar * @since Catch Evolution 1.2.1 */ function catchevolution_footer_menu() { if ( has_nav_menu( 'footer', 'catch-evolution' ) ) { ?>