__( 'Primary Navigation', 'nicecol' ), ) ); function is_wp_version( $is_ver ) { $wp_ver = explode( '.', get_bloginfo( 'version' ) ); $is_ver = explode( '.', $is_ver ); for( $i=0; $i<=count( $is_ver ); $i++ ) if( !isset( $wp_ver[$i] ) ) array_push( $wp_ver, 0 ); foreach( $is_ver as $i => $is_val ) if( $wp_ver[$i] < $is_val ) return false; return true; } if ( is_wp_version( '3.4' ) ) { $defaults = array( 'default-image' => get_template_directory_uri().'/images/headers/hdr.jpg', 'random-default' => false, 'width' => 1020, 'height' => 238, 'flex-height' => false, 'flex-width' => false, 'default-text-color' => '', 'header-text' => true, 'uploads' => true, 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ); add_theme_support( 'custom-header', $defaults ); // New custom-background function since Wordpress 3.4 $args = array( 'default-color' => '333333' ); add_theme_support( 'custom-background', $args ); } else { // Add a way for the custom header to be styled in the admin panel that controls // custom headers. See nicecol_admin_header_style(), below. add_custom_image_header( '', 'nicecol_admin_header_style' ); // 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 nicecol_header_image_width and nicecol_header_image_height to change these values. define( 'HEADER_IMAGE_WIDTH', apply_filters( 'nicecol_header_image_width', 1020 ) ); define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'nicecol_header_image_height', 238 ) ); add_custom_background(); } // Your changeable header business starts here if ( ! defined( 'HEADER_TEXTCOLOR' ) ) define( 'HEADER_TEXTCOLOR', '' ); // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI. if ( ! defined( 'HEADER_IMAGE' ) ) define( 'HEADER_IMAGE', '%s/images/headers/hdr.jpg' ); // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be 940 pixels wide by 198 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 ); // Don't support text inside the header image. if ( ! defined( 'NO_HEADER_TEXT' ) ) define( 'NO_HEADER_TEXT', true ); // ... 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( 'hdr' => array( 'url' => '%s/images/headers/hdr.jpg', 'thumbnail_url' => '%s/images/headers/hdr-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Hdr', 'nicecol' ) ), 'land' => array( 'url' => '%s/images/headers/land.jpg', 'thumbnail_url' => '%s/images/headers/land-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Land', 'nicecol' ) ), 'bridge' => array( 'url' => '%s/images/headers/bridge.jpg', 'thumbnail_url' => '%s/images/headers/bridge-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'Bridge', 'nicecol' ) ) ) ); } endif; if ( ! function_exists( 'nicecol_admin_header_style' ) ) : /** * Styles the header image displayed on the Appearance > Header admin panel. * * Referenced via add_custom_image_header() in nicecol_setup(). * * @since nicecol 1.0 */ function nicecol_admin_header_style() { ?> ' . __( 'Continue reading
', 'nicecol' ) . ''; } /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and nicecol_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. * * @since nicecol 1.0 * @return string An ellipsis */ function nicecol_auto_excerpt_more( $more ) { return ' …' . nicecol_continue_reading_link(); } add_filter( 'excerpt_more', 'nicecol_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. * * @since nicecol 1.0 * @return string Excerpt with a pretty "Continue Reading" link */ function nicecol_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= nicecol_continue_reading_link(); } return $output; } add_filter( 'get_the_excerpt', 'nicecol_custom_excerpt_more' ); /** * Remove inline styles printed when the gallery shortcode is used. * * Galleries are styled by the theme in nicecol's style.css. This is just * a simple filter call that tells WordPress to not use the default styles. * * @since nicecol 1.2 */ add_filter( 'use_default_gallery_style', '__return_false' ); /** * Deprecated way to remove inline styles printed when the gallery shortcode is used. * * This function is no longer needed or used. Use the use_default_gallery_style * filter instead, as seen above. * * @since nicecol 1.0 * @deprecated Deprecated in nicecol 1.2 for WordPress 3.1 * * @return string The gallery style filter, with the styles themselves removed. */ function nicecol_remove_gallery_css( $css ) { return preg_replace( "##s", '', $css ); } // Backwards compatibility with WordPress 3.0. if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) add_filter( 'gallery_style', 'nicecol_remove_gallery_css' ); if ( ! function_exists( 'nicecol_comment' ) ) : /** * Template for comments and pingbacks. * * To override this walker in a child theme without modifying the comments template * simply create your own nicecol_comment(), and that function will be used instead. * * Used as a callback by wp_list_comments() for displaying the comments. * * @since nicecol 1.0 */ function nicecol_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case '' : ?>
__( 'Primary Widget Area', 'nicecol' ), 'id' => 'primary-widget-area', 'description' => __( 'The primary widget area', 'nicecol' ), 'before_widget' => '