* add_action( 'after_setup_theme', 'my_child_theme_setup' ); * function my_child_theme_setup() { * // We are providing our own filter for excerpt_length (or using the unfiltered value) * remove_filter( 'excerpt_length', 'catchevolution_excerpt_length' ); * ... * } * * * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API. * * @package Catch Themes * @subpackage Catch_Evolution * @since Catch Evolution 1.0 */ /** * Sets up the content width value based on the theme's design and stylesheet. */ if ( ! isset( $content_width ) ) $content_width = 678; if ( ! function_exists( 'catchevolution_content_width' ) ) : /** * Change the content width based on the Theme Settings and Page/Post Settings */ function catchevolution_content_width() { //Getting Ready to load data from Theme Options Panel global $post, $wp_query, $content_width, $catchevolution_options_settings; $options = $catchevolution_options_settings; $themeoption_layout = $options['sidebar_layout']; // Front page displays in Reading Settings $page_on_front = get_option('page_on_front') ; $page_for_posts = get_option('page_for_posts'); // Get Page ID outside Loop $page_id = $wp_query->get_queried_object_id(); // Blog Page setting in Reading Settings if ( $page_id == $page_for_posts ) { $layout = get_post_meta( $page_for_posts,'catchevolution-sidebarlayout', true ); } // Settings for page/post/attachment elseif ( $post) { if ( is_attachment() ) { $parent = $post->post_parent; $layout = get_post_meta( $parent,'catchevolution-sidebarlayout', true ); } else { $layout = get_post_meta( $post->ID,'catchevolution-sidebarlayout', true ); } } if ( empty( $layout ) || ( !is_page() && !is_single() ) ) { $layout='default'; } if ( ( $layout == 'three-columns' || ( $layout=='default' && $themeoption_layout == 'three-columns') ) ) { $content_width = 454; /* pixels */ } } endif; // catchevolution_content_width add_action( 'template_redirect', 'catchevolution_content_width' ); /** * Tell WordPress to run catchevolution_setup() when the 'after_setup_theme' hook is run. */ add_action( 'after_setup_theme', 'catchevolution_setup' ); if ( ! function_exists( 'catchevolution_setup' ) ): /** * 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. * * To override catchevolution_setup() in a child theme, add your own catchevolution_setup to your child theme's * functions.php file. * * @uses load_theme_textdomain() For translation/localization support. * @uses add_editor_style() To style the visual editor. * @uses add_theme_support() To add support for post thumbnails, automatic feed links,custom headers and backgrounds. * @uses register_nav_menus() To add support for navigation menus. * @uses register_default_headers() To register the default custom header images provided with the theme. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since Catch Evolution 1.0 */ function catchevolution_setup() { /** * Make theme available for translation * Translations can be filed in the /languages/ directory * If you're building a theme based on Catch Evolution, use a find and replace * to change 'catchevolution' to the name of your theme in all the template files */ load_theme_textdomain( 'catchevolution', get_template_directory() . '/languages' ); /** * Add callback for custom TinyMCE editor stylesheets. (editor-style.css) * @see http://codex.wordpress.org/Function_Reference/add_editor_style */ add_editor_style(); // Add default posts and comments RSS feed links to
. add_theme_support( 'automatic-feed-links' ); /** * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded