/** * Implementation of the Custom Header feature * Setup the WordPress core custom header feature and default custom headers packaged with the theme. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. */ function catchresponsive_custom_header() { $options = catchresponsive_get_theme_options(); if ('light' == $options['color_scheme']) { $default_header_color = catchresponsive_get_default_theme_options(); $default_header_color = $default_header_color['header_textcolor']; } else { if ('dark' == $options['color_scheme']) { $default_header_color = catchresponsive_default_dark_color_options(); $default_header_color = $default_header_color['header_textcolor']; } } $args = array('default-text-color' => $default_header_color, 'default-image' => get_template_directory_uri() . '/images/headers/buddha.jpg', 'height' => 400, 'width' => 1200, 'flex-height' => true, 'flex-width' => true, 'random-default' => false, 'wp-head-callback' => 'catchresponsive_header_style', 'admin-head-callback' => 'catchresponsive_admin_header_style', 'admin-preview-callback' => 'catchresponsive_admin_header_image'); $args = apply_filters('custom-header', $args); // Add support for custom header add_theme_support('custom-header', $args); }
/** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. */ function catchresponsive_setup() { /** * Get Theme Options Values */ $options = catchresponsive_get_theme_options(); /** * Make theme available for translation * Translations can be filed in the /languages/ directory * If you're building a theme based on catchresponsive, use a find and replace * to change 'catch-responsive' to the name of your theme in all the template files */ load_theme_textdomain('catch-responsive', get_template_directory() . '/languages'); /** * Add default posts and comments RSS feed links to head */ add_theme_support('automatic-feed-links'); /** * Enable support for Post Thumbnails on posts and pages * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support('post-thumbnails'); // Add Catch Responsive's custom image sizes add_image_size('catchresponsive-slider', 1200, 514, true); // Used for Featured slider Ratio 21:9 add_image_size('catchresponsive-featured-content', 350, 197, true); // used in Featured Content Options Ratio 16:9 //Archive Images add_image_size('catchresponsive-featured', 860, 484, true); // used in Archive Top Ratio 16:9 add_image_size('catchresponsive-square', 200, 200, true); // used in Archive Left/Right Ratio 1:1 /** * This theme uses wp_nav_menu() in one location. */ register_nav_menus(array('primary' => __('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'; } else { if ('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' => 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'); /** * 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')); } else { if ('infinite-scroll-scroll' == $pagination_type) { add_theme_support('infinite-scroll', array('type' => 'scroll', 'container' => 'main', 'footer' => 'page')); } } }
/** * Returns list of color keys of array with default values for each color scheme as index * * @since Catch Base 2.1 */ function catchresponsive_color_list() { // Get default color scheme values $default = catchresponsive_get_default_theme_options(); // Get default dark color scheme valies $default_dark = catchresponsive_default_dark_color_options(); $catchresponsive_color_list['background_color']['light'] = $default['background_color']; $catchresponsive_color_list['background_color']['dark'] = $default_dark['background_color']; $catchresponsive_color_list['header_textcolor']['light'] = $default['header_textcolor']; $catchresponsive_color_list['header_textcolor']['dark'] = $default_dark['header_textcolor']; return $catchresponsive_color_list; }