__( 'Primary Menu', 'bluesip' ), ) ); } endif; // bluesip_setup add_action( 'after_setup_theme', 'bluesip_setup' ); /** * Enqueue scripts and styles */ function bluesip_scripts() { wp_enqueue_style( 'style', get_stylesheet_uri() ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } wp_enqueue_script( 'small-menu', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20120206', true ); if ( is_singular() && wp_attachment_is_image() ) { wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' ); } } add_action( 'wp_enqueue_scripts', 'bluesip_scripts' ); /** * New title-tag and backwards compatibility * * @since bluesip 1.3.6 */ if ( ! function_exists( '_wp_render_title_tag' ) ) : function bluesip_render_title() { add_filter( 'wp_title', 'bluesip_wp_title', 10, 2 ); ?> <?php wp_title( '|', true, 'right' ); ?> = 2 || $page >= 2 ) { $mytitle = "$mytitle $separated " . sprintf( __( 'Page %s', 'bluesip' ), max( $paged, $page ) ); } return $mytitle; } if ( ! function_exists( 'bluesip_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. * * @since bluesip 1.0 */ function bluesip_posted_on() { printf( __( 'Posted on by ', 'bluesip' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'bluesip' ), get_the_author() ) ), esc_html( get_the_author() ) ); } endif; if ( ! function_exists( 'bluesip_date_posts' ) ) : /** * Prints HTML for the current post-date in index * * See http://codex.wordpress.org/Formatting_Date_and_Time * * @since bluesip 1.0 */ function bluesip_date_posts() { printf( __('
%1$s
%2$s
', 'bluesip'), esc_html( get_the_date( 'j' ) ), esc_html( get_the_date( 'M' ) ) ); } endif; if ( ! function_exists( 'bluesip_show_avatar' ) ) : /** * Show the Avatar of Author for the current post * * See http://codex.wordpress.org/Function_Reference/get_avatar * * @since bluesip 1.0 */ function bluesip_show_avatar() { printf( __('
%1$s
', 'bluesip'), get_avatar( get_the_author_meta( 'ID' ), 64 ) ); } endif; if ( ! function_exists( 'bluesip_posted_author' ) ) : /** * Prints HTML with meta information for author in index posts. * * @since bluesip 1.0 */ function bluesip_posted_author() { printf( __( 'Posted by ', 'bluesip' ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'bluesip' ), get_the_author() ) ), esc_html( get_the_author() ) ); } endif; /** * Returns true if a blog has more than 1 category * * @since Shape 1.0 */ function bluesip_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) { // Create an array of all the categories that are attached to posts $all_the_cool_cats = get_categories( array( 'hide_empty' => 1, ) ); // Count the number of categories that are attached to the posts $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'all_the_cool_cats', $all_the_cool_cats ); } if ( '1' != $all_the_cool_cats ) { // With more than 1 category return true; } else { // if this blog has only 1 category return false; } } /** * Flush out the transients used in bluesip_categorized_blog * * @since bluesip 1.0 */ function bluesip_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'all_the_cool_cats' ); } add_action( 'edit_category', 'bluesip_category_transient_flusher' ); add_action( 'save_post', 'bluesip_category_transient_flusher' ); /** * Register widgetized area and update sidebar with default widgets * * @since bluesip 1.0 */ function bluesip_widgets_init() { register_sidebar( array( 'name' => __( 'Primary Widget Area', 'bluesip' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Widget Area 1', 'bluesip' ), 'id' => 'sidebar-footer-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Widget Area 2', 'bluesip' ), 'id' => 'sidebar-footer-2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Widget Area 3', 'bluesip' ), 'id' => 'sidebar-footer-3', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'bluesip_widgets_init' ); function bluesip_admin() { // add the Customize link to the admin menu add_theme_page( 'Customize', 'Customize', 'edit_theme_options', 'customize.php' ); } add_action ('admin_menu', 'bluesip_admin'); /** * Setup the WordPress core custom background feature. * * Use add_theme_support to register support for WordPress 3.4+ * as well as provide backward compatibility for previous versions. * Use feature detection of wp_get_theme() which was introduced * in WordPress 3.4. * * Hooks into the after_setup_theme action. * */ function bluesip_register_custom_background() { $args = array( 'default-color' => 'ffffff', ); $args = apply_filters( 'bluesip_custom_background_args', $args ); if ( function_exists( 'wp_get_theme' ) ) { add_theme_support( 'custom-background', $args ); } else { define( 'BACKGROUND_COLOR', $args['default-color'] ); define( 'BACKGROUND_IMAGE', $args['default-image'] ); add_theme_support(); } } add_action( 'after_setup_theme', 'bluesip_register_custom_background' ); /** * Register add_editor_style * * @since bluesip 1.3.6 */ function bluesip_add_editor_styles() { $font_url = str_replace( ',', '%2C', '//fonts.googleapis.com/css?family=Quattrocento+Sans' ); add_editor_style( $font_url ); } add_action( 'after_setup_theme', 'bluesip_add_editor_styles' ); /** * Implement the Custom Header feature. * * @since Bluesip 1.3.6 */ require( get_template_directory() . '/inc/custom-header.php' ); require( get_template_directory() . '/inc/customize.php' );