__( 'Primary Menu', 'seismicnyc' ), ) ); /** * This theme allows users to set a custom background. */ add_theme_support( 'custom-background', array( 'default-color' => '333333', ) ); /** * Add support for the Aside and Gallery Post Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'gallery' ) ); } endif; // seismicnyc_setup /** * Tell WordPress to run seismicnyc_setup() when the 'after_setup_theme' hook is run. */ add_action( 'after_setup_theme', 'seismicnyc_setup' ); /** * Tell WordPress to add a customizable header image. */ function seismicnyc_custom_header_image() { /** * This theme allows users to set a custom header image. */ $args = array( 'width' => 690, 'height' => 350, 'default-image' => get_template_directory_uri() . '/imgs/header/manhattan.jpg', 'default-text-color' => 'fff', 'header-text' => true, 'uploads' => true, 'wp-head-callback' => 'seismicnyc_custom_header_image', 'admin-head-callback' => 'seismicnyc_admin_header_style', ); add_theme_support( 'custom-header', $args ); /* * Default custom headers packaged with the theme. */ register_default_headers( array( 'manhattan' => array( 'url' => '%s/imgs/header/manhattan.jpg', 'thumbnail_url' => '%s/imgs/header/manhattan-thumbnail.jpg', 'description' => _x( 'Manhattan', 'header image description', 'seismicnyc' ) ), 'brooklyn-bridge' => array( 'url' => '%s/imgs/header/brooklyn-bridge.jpg', 'thumbnail_url' => '%s/imgs/header/brooklyn-bridge-thumbnail.jpg', 'description' => _x( 'Brooklyn Bridge', 'header image description', 'seismicnyc' ) ), ) ); } add_action( 'after_setup_theme', 'seismicnyc_custom_header_image' ); /** * Tell WordPress to customize the page title. */ function seismicnyc_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'seismicnyc' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'seismicnyc_wp_title', 10, 2 ); /** * Style the WordPress admin section header. */ if ( ! function_exists( 'seismicnyc_admin_header_style' ) ) : function seismicnyc_admin_header_style() { ?> __( 'Sidebar', 'seismicnyc' ), 'id' => 'sidebar', 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'seismicnyc_widgets_init' ); if ( ! function_exists( 'seismicnyc_content_nav' ) ): /** * Display navigation to next/previous pages when applicable */ function seismicnyc_content_nav( $nav_id ) { global $wp_query; ?> comment_type ) : case 'pingback' : case 'trackback' : ?>
  • id="li-comment-">
    says:', 'seismicnyc' ), sprintf( '%s', get_comment_author_link() ) ); ?>
    comment_approved == '0' ) : ?>
    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    Posted on by ', 'seismicnyc' ), 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', 'seismicnyc' ), get_the_author() ) ), esc_html( get_the_author() ) ); } endif; /** * Returns true if a blog has more than 1 category */ function seismicnyc_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 seismicnyc_categorized_blog should return true return true; } else { // This blog has only 1 category so seismicnyc_categorized_blog should return false return false; } } /** * Flush out the transients used in seismicnyc_categorized_blog */ function seismicnyc_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'all_the_cool_cats' ); } add_action( 'edit_category', 'seismicnyc_category_transient_flusher' ); add_action( 'save_post', 'seismicnyc_category_transient_flusher' ); /** * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages */ function seismicnyc_enhanced_image_navigation( $url ) { global $post, $wp_rewrite; $id = (int) $post->ID; $object = get_post( $id ); if ( wp_attachment_is_image( $post->ID ) && ( $wp_rewrite->using_permalinks() && ( $object->post_parent > 0 ) && ( $object->post_parent != $id ) ) ) $url = $url . '#main'; return $url; } add_filter( 'attachment_link', 'seismicnyc_enhanced_image_navigation' ); /** * Tell WordPress to add our stylesheets to the head. */ function seismicnyc_theme_scripts() { wp_enqueue_style('normalize', get_stylesheet_directory_uri().'/css/normalize.css', false, '2.0.1'); wp_enqueue_style('seismicnyc-style', get_bloginfo('stylesheet_url'), false, '0.1'); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action('wp_enqueue_scripts', 'seismicnyc_theme_scripts');