__( '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 );
wp_enqueue_script( 'main-menu', get_template_directory_uri() . '/js/selectnav.js', array(), '2013', 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' );
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 %7$s', '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_posted_author' ) ) :
/**
* Prints HTML with meta information for author in index posts.
*
* @since bluesip 1.0
*/
function bluesip_posted_author() {
printf( __( 'Posted by %3$s', '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 ) {
// This blog has more than 1 category so shape_categorized_blog should return true
return true;
} else {
// This blog has only 1 category so shape_categorized_blog should return false
return false;
}
}
/**
* Flush out the transients used in shape_categorized_blog
*
* @since Shape 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' => '