__( 'Primary Navigation', 'autofocus' ), ) ); } endif; /** * Template for comments and pingbacks. */ if ( ! function_exists( 'autofocus_comment' ) ) : function autofocus_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'comment' : ?>
widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } add_action( 'widgets_init', 'autofocus_remove_recent_comments_style' ); /** * Prints HTML with meta information for the current post—date/time and author. */ if ( ! function_exists( 'autofocus_posted_on' ) ) : function autofocus_posted_on() { printf( '', 'entry-date', esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date('Y-m-d\TH:i') ), esc_attr( get_the_date() ) ); } endif; /** * Prints HTML with meta information for the current post (date, author, category, tags and permalink). */ if ( ! function_exists( 'autofocus_post_meta' ) ) : function autofocus_post_meta() { printf( __( 'By: %2$s', 'autofocus' ), 'entry-author', sprintf( '%3$s', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), sprintf( esc_attr__( 'View all posts by %s', 'autofocus' ), get_the_author() ), esc_html( get_the_author() ) ) ); // Retrieves tag list of current post, separated by commas. $tag_list = get_the_tag_list( '', ', ' ); if ( $tag_list ) { $posted_in = __( 'Filed under %1$s. Bookmark the permalink.', 'autofocus' ); } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { $posted_in = __( 'Filed under %1$s. Bookmark the permalink.', 'autofocus' ); } else { $posted_in = __( 'Bookmark the permalink.', 'autofocus' ); } // Prints the string, replacing the placeholders. printf( $posted_in, get_the_category_list( ', ' ), $tag_list, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ) ); } endif; /** * Display Author Avatar */ function autofocus_author_info_avatar() { global $wp_query; $curauth = $wp_query->get_queried_object(); $email = $curauth->user_email; $avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar("$email") ); echo $avatar; } /** * Previous / Next Excerpts * - Thanks very much to Thin & Light (http://thinlight.org/) for this custom function! */ function autofocus_excerpt($text, $excerpt_length = 25) { $text = str_replace(']]>', ']]>', $text); $text = strip_tags($text); $text = preg_replace("/\[.*?]/", "", $text); $words = explode(' ', $text, $excerpt_length + 1); if (count($words) > $excerpt_length) { array_pop($words); array_push($words, '...'); $text = implode(' ', $words); } return apply_filters('the_excerpt', $text); } // Setup AF Post Excerpt function autofocus_post_excerpt($post) { $excerpt = ($post->post_excerpt == '') ? (autofocus_excerpt($post->post_content)) : (apply_filters('the_excerpt', $post->post_excerpt)); return $excerpt; } // Setup Previous Post Excerpt function previous_post_excerpt($in_same_cat = 1, $excluded_categories = '') { if ( is_attachment() ) $post = &get_post($GLOBALS['post']->post_parent); else $post = get_previous_post($in_same_cat, $excluded_categories); if ( !$post ) return; $post = &get_post($post->ID); echo autofocus_post_excerpt($post); } // Setup Next Post Excerpt function next_post_excerpt($in_same_cat = 1, $excluded_categories = '') { if ( is_attachment() ) $post = &get_post($GLOBALS['post']->post_parent); else $post = get_next_post($in_same_cat, $excluded_categories); if ( !$post ) return; $post = &get_post($post->ID); echo autofocus_post_excerpt($post); } /** * AutoFocus Navigation Above */ function autofocus_nav_above() { global $post, $excluded_categories, $in_same_cat, $autofocus_shortname; // Grab The Blog Category $autofocus_blog_catid = of_get_option( $autofocus_shortname . '_blog_cat' ); if ( in_category( $autofocus_blog_catid ) ) : ?> __( 'Page Widget Area', 'autofocus' ), 'id' => 'page-widget-area', 'description' => __( 'This widget area shows up on pages only', 'autofocus' ), 'before_widget' => '