comment_approved == '0' ): ?>
comment_content ); ?>
__( 'Primary Menu', 'straightup' ), ) ); /** * Add support for the Aside Post Formats */ add_theme_support( 'post-formats', array( 'aside', ) ); } add_action( 'after_setup_theme', 'straightup_setup' ); /** * Register widgetized area and update sidebar with default widgets * * @since 1.0 */ function straightup_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'straightup' ), 'id' => 'sidebar-1', 'before_widget' => '", 'before_title' => '
' . esc_html__( 'Your email will not be published. Name and Email fields are required.', 'straightup' ) . '
'; return $args; } add_filter( 'comment_form_defaults', 'straightup_comment_form_args' ); /** * Add additional classes to the body element * * @since 1.0 */ function straightup_body_classes( $classes ) { // Adds a class of group-blog to blogs with more than 1 published author if ( is_multi_author() ) { $classes[] = 'group-blog'; } return $classes; } add_filter( 'body_class', 'straightup_body_classes' ); /** * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages * * @since 1.0 */ function straightup_enhanced_image_navigation( $url, $id ) { if ( ! is_attachment() && ! wp_attachment_is_image( $id ) ) return $url; $image = get_post( $id ); if ( ! empty( $image->post_parent ) && $image->post_parent != $id ) $url .= '#main'; return $url; } add_filter( 'attachment_link', 'straightup_enhanced_image_navigation', 10, 2 ); /** * Display navigation to next/previous pages when applicable * * @since 1.0 */ function straightup_content_nav( $nav_id ) { global $wp_query; $nav_class = 'site-navigation paging-navigation'; if ( is_single() ) $nav_class = 'site-navigation post-navigation'; ?> ', 'straightup' ), 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', 'straightup' ), get_the_author() ) ), esc_html( get_the_author() ) ); } /** * Returns true if a blog has more than one category * * @since 1.0 */ function straightup_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 straightup_categorized_blog should return true return true; } else { // This blog has only 1 category so straightup_categorized_blog should return false return false; } } /** * Flush out the transients used in straightup_categorized_blog * * @since 1.0 */ function straightup_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'all_the_cool_cats' ); } add_action( 'edit_category', 'straightup_category_transient_flusher' ); add_action( 'save_post', 'straightup_category_transient_flusher' );