__( 'Primary Menu', 'catch-responsive' ), 'secondary' => __( 'Secondary Menu', 'catch-responsive' ), ) ); /** * Enable support for Post Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); /** * Setup the WordPress core custom background feature. */ if ( 'light' == $options['color_scheme'] ) { $default_bg_color = catchresponsive_get_default_theme_options(); $default_bg_color = $default_bg_color['background_color']; $default_bg_image = 'body-bg.jpg'; } elseif ( 'dark' == $options['color_scheme'] ) { $default_bg_color = catchresponsive_default_dark_color_options(); $default_bg_color = $default_bg_color['background_color']; $default_bg_image = 'body-bg-dark.jpg'; } add_theme_support( 'custom-background', apply_filters( 'catchresponsive_custom_background_args', array( 'default-color' => $default_bg_color, 'default-image' => trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'images/' . $default_bg_image, ) ) ); /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, icons, and column width. */ add_editor_style( array( 'css/editor-style.css', catchresponsive_fonts_url() ) ); /** * Setup title support for theme * Supported from WordPress version 4.1 onwards * More Info: https://make.wordpress.org/core/2014/10/29/title-tags-in-4-1/ */ add_theme_support( 'title-tag' ); //@remove Remove check when WordPress 4.8 is released if ( function_exists( 'has_custom_logo' ) ) { /** * Setup Custom Logo Support for theme * Supported from WordPress version 4.5 onwards * More Info: https://make.wordpress.org/core/2016/03/10/custom-logo/ */ add_theme_support( 'custom-logo' ); } /** * Setup Infinite Scroll using JetPack if navigation type is set */ $pagination_type = $options['pagination_type']; if ( 'infinite-scroll-click' == $pagination_type ) { add_theme_support( 'infinite-scroll', array( 'type' => 'click', 'container' => 'main', 'footer' => 'page' ) ); } elseif ( 'infinite-scroll-scroll' == $pagination_type ) { //Override infinite scroll disable scroll option update_option('infinite_scroll', true); add_theme_support( 'infinite-scroll', array( 'type' => 'scroll', 'container' => 'main', 'footer' => 'page' ) ); } } endif; // catchresponsive_setup add_action( 'after_setup_theme', 'catchresponsive_setup' ); /** * Return the Google font stylesheet URL, if available. * * The use of Open Sans and Droid Sans by default is localized. For languages * that use characters not supported by the font, the font can be disabled. * * @since Catch Responsive 1.0 * * @return string Font stylesheet or empty string if disabled. */ function catchresponsive_fonts_url() { $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by Open Sans, translate this to 'off'. Do not translate * into your own language. */ $open_sans = _x( 'on', 'Open Sans font: on or off', 'catch-responsive' ); /* Translators: If there are characters in your language that are not * supported by Droid Sans, translate this to 'off'. Do not translate into your * own language. */ $droid_sans = _x( 'on', 'Droid Sans font: on or off', 'catch-responsive' ); if ( 'off' !== $open_sans || 'off' !== $droid_sans ) { $font_families = array(); if ( 'off' !== $open_sans ) $font_families[] = 'Open Sans:300,400,700,300italic,400italic,700italic'; if ( 'off' !== $droid_sans ) $font_families[] = 'Droid Sans:400,700'; $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" ); } return $fonts_url; } /** * Enqueue scripts and styles * * @uses wp_register_script, wp_enqueue_script, wp_register_style, wp_enqueue_style, wp_localize_script * @action wp_enqueue_scripts * * @since Catch Responsive 1.0 */ function catchresponsive_scripts() { $options = catchresponsive_get_theme_options(); // Add Source Sans Pro and Bitter fonts, used in the main stylesheet. wp_enqueue_style( 'catchresponsive-fonts', catchresponsive_fonts_url(), array(), null ); wp_enqueue_style( 'catchresponsive-style', get_stylesheet_uri() ); wp_enqueue_script( 'catchresponsive-navigation', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/navigation.min.js', array(), '20120206', true ); // Load the html5 shiv. wp_enqueue_script( 'catchresponsive-html5', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/html5.min.js', array(), '3.7.3' ); wp_script_add_data( 'catchresponsive-html5', 'conditional', 'lt IE 9' ); wp_enqueue_script( 'catchresponsive-skip-link-focus-fix', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/skip-link-focus-fix.min.js', array(), '20130115', 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' ); } //For genericons wp_enqueue_style( 'genericons', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'css/genericons/genericons.css', false, '3.4.1' ); /** * Enqueue the styles for the current color scheme for catchresponsive. */ if ( $options['color_scheme'] != 'light' ) { wp_enqueue_style( 'catchresponsive-dark', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'css/colors/dark.css', array(), null ); } /** * Loads up Responsive Menu */ wp_enqueue_script( 'jquery-sidr', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/jquery.sidr.min.js', array('jquery'), '2.2.1.1', false ); /** * Loads default sidr color scheme styles(Does not require handle prefix) */ if ( 'dark' == $options['mobile_menu_color_scheme'] ){ wp_enqueue_style( 'jquery-sidr', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'css/jquery.sidr.dark.min.css', false, '2.1.0' ); } else { wp_enqueue_style( 'jquery-sidr', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'css/jquery.sidr.light.min.css', false, '2.1.0' ); } wp_enqueue_script( 'jquery-fitvids', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/fitvids.min.js', array( 'jquery' ), '1.1', true ); /** * Loads up Cycle JS */ if ( $options['featured_slider_option'] != 'disabled' ) { wp_register_script( 'jquery-cycle2', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/jquery.cycle/jquery.cycle2.min.js', array( 'jquery' ), '2.1.5', true ); /** * Condition checks for additional slider transition plugins */ // Scroll Vertical transition plugin addition if ( 'scrollVert' == $options['featured_slide_transition_effect'] ){ wp_enqueue_script( 'jquery-cycle2-scrollVert', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/jquery.cycle/jquery.cycle2.scrollVert.min.js', array( 'jquery-cycle2' ), '20140128', true ); } // Flip transition plugin addition elseif ( 'flipHorz' == $options['featured_slide_transition_effect'] || 'flipVert' == $options['featured_slide_transition_effect'] ){ wp_enqueue_script( 'jquery-cycle2-flip', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/jquery.cycle/jquery.cycle2.flip.min.js', array( 'jquery-cycle2' ), '20140128', true ); } // Shuffle transition plugin addition elseif ( 'tileSlide' == $options['featured_slide_transition_effect'] || 'tileBlind' == $options['featured_slide_transition_effect'] ){ wp_enqueue_script( 'jquery-cycle2-tile', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/jquery.cycle/jquery.cycle2.tile.min.js', array( 'jquery-cycle2' ), '20140128', true ); } // Shuffle transition plugin addition elseif ( 'shuffle' == $options['featured_slide_transition_effect'] ){ wp_enqueue_script( 'jquery-cycle2-shuffle', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/jquery.cycle/jquery.cycle2.shuffle.min.js', array( 'jquery-cycle2' ), '20140128 ', true ); } else { wp_enqueue_script( 'jquery-cycle2' ); } } /** * Loads up Scroll Up script */ if ( ! $options['disable_scrollup'] ) { wp_enqueue_script( 'catchresponsive-scrollup', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/catchresponsive-scrollup.min.js', array( 'jquery' ), '20072014', true ); } /** * Enqueue custom script for catchresponsive. */ wp_enqueue_script( 'catchresponsive-custom-scripts', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/catchresponsive-custom-scripts.min.js', array( 'jquery' ), null ); } add_action( 'wp_enqueue_scripts', 'catchresponsive_scripts' ); /** * Enqueue scripts and styles for Metaboxes * @uses wp_register_script, wp_enqueue_script, and wp_enqueue_style * * @action admin_print_scripts-post-new, admin_print_scripts-post, admin_print_scripts-page-new, admin_print_scripts-page * * @since Catch Responsive 1.0 */ function catchresponsive_enqueue_metabox_scripts() { //Scripts wp_enqueue_script( 'catchresponsive-metabox', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'js/catchresponsive-metabox.min.js', array( 'jquery', 'jquery-ui-tabs' ), '2013-10-05' ); //CSS Styles wp_enqueue_style( 'catchresponsive-metabox-tabs', trailingslashit( esc_url ( get_template_directory_uri() ) ) . 'css/catchresponsive-metabox-tabs.css' ); } add_action( 'admin_print_scripts-post-new.php', 'catchresponsive_enqueue_metabox_scripts', 11 ); add_action( 'admin_print_scripts-post.php', 'catchresponsive_enqueue_metabox_scripts', 11 ); add_action( 'admin_print_scripts-page-new.php', 'catchresponsive_enqueue_metabox_scripts', 11 ); add_action( 'admin_print_scripts-page.php', 'catchresponsive_enqueue_metabox_scripts', 11 ); /** * Default Options. */ require trailingslashit( get_template_directory() ) . 'inc/catchresponsive-default-options.php'; /** * Custom Header. */ require trailingslashit( get_template_directory() ) . 'inc/catchresponsive-custom-header.php'; /** * Structure for catchresponsive */ require trailingslashit( get_template_directory() ) . 'inc/catchresponsive-structure.php'; /** * Customizer additions. */ require trailingslashit( get_template_directory() ) . 'inc/customizer-includes/catchresponsive-customizer.php'; /** * Custom Menus */ require trailingslashit( get_template_directory() ) . 'inc/catchresponsive-menus.php'; /** * Load Slider file. */ require trailingslashit( get_template_directory() ) . 'inc/catchresponsive-featured-slider.php'; /** * Load Featured Content. */ require trailingslashit( get_template_directory() ) . 'inc/catchresponsive-featured-content.php'; /** * Load Breadcrumb file. */ require trailingslashit( get_template_directory() ) . 'inc/catchresponsive-breadcrumb.php'; /** * Load Widgets and Sidebars */ require trailingslashit( get_template_directory() ) . 'inc/catchresponsive-widgets.php'; /** * Load Social Icons */ require trailingslashit( get_template_directory() ) . 'inc/catchresponsive-social-icons.php'; /** * Load Metaboxes */ require trailingslashit( get_template_directory() ) . 'inc/catchresponsive-metabox.php'; /** * Returns the options array for catchresponsive. * @uses get_theme_mod * * @since Catch Responsive 1.0 */ function catchresponsive_get_theme_options() { $catchresponsive_default_options = catchresponsive_get_default_theme_options(); return array_merge( $catchresponsive_default_options , get_theme_mod( 'catchresponsive_theme_options', $catchresponsive_default_options ) ) ; } /** * Flush out all transients * * @uses delete_transient * * @action customize_save, catchresponsive_customize_preview (see catchresponsive_customizer function: catchresponsive_customize_preview) * * @since Catch Responsive 1.0 */ function catchresponsive_flush_transients(){ delete_transient( 'catchresponsive_featured_content' ); delete_transient( 'catchresponsive_featured_slider' ); delete_transient( 'catchresponsive_custom_css' ); delete_transient( 'catchresponsive_footer_content' ); delete_transient( 'catchresponsive_promotion_headline' ); delete_transient( 'catchresponsive_featured_image' ); delete_transient( 'catchresponsive_social_icons' ); delete_transient( 'catchresponsive_scrollup' ); delete_transient( 'all_the_cool_cats' ); //Add Catchresponsive default themes if there is no values if ( !get_theme_mod('catchresponsive_theme_options') ) { set_theme_mod( 'catchresponsive_theme_options', catchresponsive_get_default_theme_options() ); } } add_action( 'customize_save', 'catchresponsive_flush_transients' ); /** * Flush out category transients * * @uses delete_transient * * @action edit_category * * @since Catch Responsive 1.0 */ function catchresponsive_flush_category_transients(){ delete_transient( 'all_the_cool_cats' ); } add_action( 'edit_category', 'catchresponsive_flush_category_transients' ); /** * Flush out post related transients * * @uses delete_transient * * @action save_post * * @since Catch Responsive 1.0 */ function catchresponsive_flush_post_transients(){ delete_transient( 'catchresponsive_featured_content' ); delete_transient( 'catchresponsive_featured_slider' ); delete_transient( 'catchresponsive_featured_image' ); delete_transient( 'all_the_cool_cats' ); } add_action( 'save_post', 'catchresponsive_flush_post_transients' ); if ( ! function_exists( 'catchresponsive_custom_css' ) ) : /** * Enqueue Custon CSS * * @uses set_transient, wp_head, wp_enqueue_style * * @action wp_enqueue_scripts * * @since Catch Responsive 1.0 */ function catchresponsive_custom_css() { //catchresponsive_flush_transients(); $options = catchresponsive_get_theme_options(); $defaults = catchresponsive_get_default_theme_options(); if ( ( !$catchresponsive_custom_css = get_transient( 'catchresponsive_custom_css' ) ) ) { $catchresponsive_custom_css =''; // Has the text been hidden? if ( ! display_header_text() ) { $catchresponsive_custom_css .= ".site-title a, .site-description { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); }". "\n"; } //Custom CSS Option if ( !empty( $options['custom_css'] ) ) { $catchresponsive_custom_css .= $options['custom_css'] . "\n"; } if ( '' != $catchresponsive_custom_css ){ echo '' . "\n"; $catchresponsive_custom_css = '' . "\n" . '' . "\n"; } set_transient( 'catchresponsive_custom_css', htmlspecialchars_decode( $catchresponsive_custom_css ), 86940 ); } echo $catchresponsive_custom_css; } endif; //catchresponsive_custom_css add_action( 'wp_head', 'catchresponsive_custom_css', 101 ); if ( ! function_exists( 'catchresponsive_content_nav' ) ) : /** * Display navigation to next/previous pages when applicable * * @since Catch Responsive 1.0 */ function catchresponsive_content_nav( $nav_id ) { global $wp_query, $post; // Don't print empty markup on single pages if there's nowhere to navigate. if ( is_single() ) { $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; } // Don't print empty markup in archives if there's only one page. if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) { return; } $options = catchresponsive_get_theme_options(); $pagination_type = $options['pagination_type']; $nav_class = ( is_single() ) ? 'site-navigation post-navigation' : 'site-navigation paging-navigation'; /** * Check if navigation type is Jetpack Infinite Scroll and if it is enabled, else goto default pagination * if it's active then disable pagination */ if ( ( 'infinite-scroll-click' == $pagination_type || 'infinite-scroll-scroll' == $pagination_type ) && class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'infinite-scroll' ) ) { return false; } ?> comment_type || 'trackback' == $comment->comment_type ) : ?>
' . $promotion_subheadline . '
'; } $catchresponsive_promotion_headline .= '