* 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', 'anIMass_excerpt_length' ); * ... * } * * * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API. * * @package WordPress * @subpackage anINmass * @since anIMass v7.0 * */ /** * Set the content width based on the theme's design and stylesheet. * * Used to set the width of images and content. Should be equal to the width the theme * is designed for, generally via the style.css stylesheet. */ if ( ! isset( $content_width ) ) $content_width = 460; /** Tell WordPress to run anIMass_setup() when the 'after_setup_theme' hook is run. */ add_action( 'after_setup_theme', 'anIMass_setup' ); if ( ! function_exists( 'anIMass_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 anIMass_setup() in a child theme, add your own anIMass_setup to your child theme's * functions.php file. * * @uses add_theme_support() To add support for post thumbnails and automatic feed links. * @uses register_nav_menus() To add support for navigation menus. * @uses add_custom_background() To add support for a custom background. * @uses add_editor_style() To style the visual editor. * @uses load_theme_textdomain() For translation/localization support. * @uses add_custom_image_header() To add support for a custom header. * @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 anIMass 7.2 */ function anIMass_setup() { // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // This theme uses post thumbnails add_theme_support( 'post-thumbnails' ); // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); // Make theme available for translation // Translations can be filed in the /languages/ directory load_theme_textdomain( 'anIMass', TEMPLATEPATH . '/languages' ); $locale = get_locale(); $locale_file = TEMPLATEPATH . "/languages/$locale.php"; if ( is_readable( $locale_file ) ) require_once( $locale_file ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'anIMass' ), ) ); // This theme allows users to set a custom background add_custom_background(); // Your changeable header business starts here define( 'HEADER_TEXTCOLOR', '444444' ); // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI. define( 'HEADER_IMAGE', '%s/images/headers/header.jpg' ); //The height and width of your custom header. You can hook into the theme's own filters to change these values. // Add a filter to anIMass_header_image_width and anIMass_header_image_height to change these values. define( 'HEADER_IMAGE_WIDTH', apply_filters( 'anIMass_header_image_width', 860 ) ); define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'anIMass_header_image_height', 162 ) ); // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be 860 pixels wide by 162 pixels tall. // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); // Add a way for the custom header to be styled in the admin panel that controls // custom headers. See anIMass_admin_header_style(), below. add_custom_image_header( '', 'anIMass_admin_header_style' ); // ... and thus ends the changeable header business. // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( array( 'mview' => array( 'url' => '%s/images/headers/mview.jpg', 'thumbnail_url' => '%s/images/headers/mview-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Mountain View', 'anIMass' ) ), 'anewday' => array( 'url' => '%s/images/headers/anewday.jpg', 'thumbnail_url' => '%s/images/headers/anewday-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'A New Day', 'anIMass' ) ), 'dream-on' => array( 'url' => '%s/images/headers/dream-on.jpg', 'thumbnail_url' => '%s/images/headers/dream-on-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Dream-On', 'anIMass' ) ), 'pastValencia' => array( 'url' => '%s/images/headers/pastValencia.jpg', 'thumbnail_url' => '%s/images/headers/pastValencia-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Past Valencia', 'anIMass' ) ), 'header2' => array( 'url' => '%s/images/headers/headernew.jpg', 'thumbnail_url' => '%s/images/headers/headernew-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Headernew', 'anIMass' ) ) ) ); } endif; if (function_exists('add_theme_support')) { add_theme_support('nav-menus');} if ( ! function_exists( 'anIMass_admin_header_style' ) ) : /** * Styles the header image displayed on the Appearance > Header admin panel. * * Referenced via add_custom_image_header() in anIMass_setup(). * * @since anIMass 1.0 */ function anIMass_admin_header_style() { ?> tag, by filtering the output of wp_title(). * * If we have a site description and we're viewing the home page or a blog posts * page (when using a static front page), then we will add the site description. * * If we're viewing a search result, then we're going to recreate the title entirely. * We're going to add page numbers to all titles as well, to the middle of a search * result title and the end of all other titles. * * The site title also gets added to all titles. * * @since anIMass 1.0 * * @param string $title Title generated by wp_title() * @param string $separator The separator passed to wp_title(). anIMass uses a * vertical bar, "|", as a separator in header.php. * @return string The new title, ready for the
widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } add_action( 'widgets_init', 'anIMass_remove_recent_comments_style' ); if ( ! function_exists( 'anIMass_posted_on' ) ) : /** * Prints HTML with meta information for the current post—date/time and author. * * @since anIMass 1.0 */ function anIMass_posted_on() { printf( __( 'Posted on %2$s %3$s', 'anIMass' ), 'meta-prep meta-prep-author', sprintf( '%3$s', get_permalink(), esc_attr( get_the_time() ), get_the_date() ), sprintf( '', get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'anIMass' ), get_the_author() ), get_the_author() ) ); } endif; if ( ! function_exists( 'anIMass_posted_in' ) ) : /** * Prints HTML with meta information for the current post (category, tags and permalink). * * @since anIMass 7.0 */ function anIMass_posted_in() { // Retrieves tag list of current post, separated by commas. $tag_list = get_the_tag_list( '', ', ' ); if ( $tag_list ) { $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the permalink.', 'anIMass' ); } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { $posted_in = __( 'This entry was posted in %1$s. Bookmark the permalink.', 'anIMass' ); } else { $posted_in = __( 'Bookmark the permalink.', 'anIMass' ); } // Prints the string, replacing the placeholders. printf( $posted_in, get_the_category_list( ', ' ), $tag_list, get_permalink(), the_title_attribute( 'echo=0' ) ); } endif;