__( 'Primary Menu', 'next-saturday' ), ) ); } // Action hook to do all the major theme setup stuff add_action( 'after_setup_theme', 'next_saturday_setup' ); // Load scripts function next_saturday_scripts() { wp_enqueue_style( 'next-saturday', get_stylesheet_uri() ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); } add_action( 'wp_enqueue_scripts', 'next_saturday_scripts' ); /** * Audio helper script. * * If an audio shortcode exists we will enqueue javascript * that replaces all non-supported audio player instances * with text links. * * @uses shortcode_exists(); */ function next_saturday_audio_script() { if ( shortcode_exists( 'audio' ) ) return; if ( ! is_singular() || has_post_format( 'audio' ) ) wp_enqueue_script( 'next-saturday-audio', get_template_directory_uri() . '/js/audio.js', array(), '20130521' ); } add_action( 'wp_enqueue_scripts', 'next_saturday_audio_script' ); /** * 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 next_saturday_custom_background() { add_theme_support( 'custom-background', apply_filters( 'next_saturday_custom_background_args', array( 'default-color' => '', 'default-image' => '', ) ) ); } add_action( 'after_setup_theme', 'next_saturday_custom_background' ); /** * Register widgetized area and update sidebar with default widgets */ function next_saturday_widgets_init() { register_sidebar( array ( 'name' => __( 'Default sidebar', 'next-saturday' ), 'id' => 'sidebar-1', 'description' => __( 'The primary widget area.', 'next-saturday' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } // We should actually hook into 'widgets_init', but don't for child theme compat. add_action( 'init', 'next_saturday_widgets_init' ); /** * Removes the default styles that are packaged with the Recent Comments widget. */ function next_saturday_remove_recent_comments_style() { global $wp_widget_factory; if ( isset( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) { remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } } add_action( 'widgets_init', 'next_saturday_remove_recent_comments_style' ); /** * Prints HTML with meta information for the fancy display of the current post's month and day */ function next_saturday_entry_date() { printf( __( '

', 'next-saturday' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_time( 'd' ) ), esc_attr( get_the_time( 'M' ) ), esc_attr( get_the_time( 'y' ) ) ); } /** * Prints HTML with meta information for the current post (category, tags and permalink). */ function next_saturday_entry_meta() { $posted_in = ''; $tag_list = get_the_tag_list( '', ', ' ); if ( $tag_list && ! is_wp_error( $tag_list ) ) { $posted_in = __( ' Posted by . Categories: %1$s. Tags: %2$s. ', 'next-saturday' ); } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { $posted_in = __( ' Posted by . Categories: %1$s.', 'next-saturday' ); } // Prints the string, replacing the placeholders. printf( $posted_in, get_the_category_list( ', ' ), $tag_list, esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'next-saturday' ), get_the_author() ) ), esc_html( get_the_author() ) ); } /** * Display navigation to next/previous pages when applicable */ function next_saturday_content_nav( $nav_id ) { global $wp_query; if ( $wp_query->max_num_pages > 1 ) : ?> comment_type ) : case 'pingback' : case 'trackback' : ?>
  • id="li-comment-">
    comment_parent ) $avatar_size = 39; echo get_avatar( $comment, $avatar_size ); /* translators: 1: comment author, 2: date and time */ printf( __( '%1$s on %2$s said:', 'next-saturday' ), sprintf( '%s', get_comment_author_link() ), sprintf( '', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), /* translators: 1: date, 2: time */ sprintf( __( '%1$s at %2$s', 'next-saturday' ), get_comment_date(), get_comment_time() ) ) ); ?>
    comment_approved == '0' ) : ?>
    __( 'Reply ↓', 'next-saturday' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ', '' ); if ( $first_image && defined( 'WPCOM_THEMES_IMAGE_REPLACE_REGEX' ) ) $content = preg_replace( WPCOM_THEMES_IMAGE_REPLACE_REGEX, $first_image, $content, 1 ); $content = wp_kses_post( $content ); } return $content; } if ( ! is_admin() ) add_filter( 'the_content', 'next_saturday_the_content', 11 ); /** * Get a short-form mime type for an audio file to display as a class attribute. * * @param int ID of an attachment * @return string A short representation of the file's mime type. */ function next_saturday_post_classes( $classes ) { if ( has_post_format( 'audio' ) ) { $audio = next_saturday_audio_grabber( get_the_ID() ); if ( ! empty( $audio ) && is_object( $audio ) ) { $mime = str_replace( 'audio/', '', get_post_mime_type( $audio->ID ) ); if ( in_array( $mime, array( 'mp3', 'ogg', 'wav', ) ) ) $classes[] = $mime; } } return $classes; } add_filter( 'post_class', 'next_saturday_post_classes' ); if ( ! function_exists( 'the_post_format_audio' ) ) : /** * Shiv for the_post_format_audio(). * * the_post_format_audio() is part of a core plugin. To provide backward * compatibility with previous versions, we will define our * own version of this function. * * @param string $name The name of the shortcode. * @return bool True if shortcode exists; False otherwise. */ function the_post_format_audio() { $audio = next_saturday_audio_grabber( get_the_ID() ); if ( ! empty( $audio ) && is_object( $audio ) ) : $url = wp_get_attachment_url( $audio->ID ); ?>
    tag based on what is being viewed. * * @since Next Saturday 1.1 */ function next_saturday_wp_title( $title, $sep ) { global $page, $paged; if ( is_feed() ) return $title; // Add the blog name $title .= get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title .= " $sep $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) $title .= " $sep " . sprintf( __( 'Page %s', 'next-saturday' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'next_saturday_wp_title', 10, 2 ); /** * Implement the Custom Header feature. */ require( get_template_directory() . '/inc/custom-header.php' ); /** * Load up our functions for grabbing content from posts. */ require( get_template_directory() . '/content-grabbers.php' ); /** * Load Jetpack compatibility file. */ require( get_template_directory() . '/inc/jetpack.compat.php' );