max_num_pages < 2 ) { return; } ?> post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?> comment_date, 'comment' ); if ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) : ?>
  • >
  • >
    %s', get_comment_author_link() ) ); ?> ·
    comment_approved == '0' ) : ?>

    'comment-body', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    post_parent ) { /** * Grab the IDs of all the image attachments in a gallery so we can get the * URL of the next adjacent image in a gallery, or the first image (if * we're looking at the last image in a gallery), or, in a gallery of one, * just the link to that image file. */ $attachment_ids = get_posts( array( 'post_parent' => $post->post_parent, 'fields' => 'ids', 'numberposts' => 300, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ); // If there is more than 1 attachment in a gallery... if ( is_countable( $attachment_ids ) && count( $attachment_ids ) > 1 ) { foreach ( $attachment_ids as $idx => $attachment_id ) { if ( $attachment_id == $post->ID ) { $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ]; break; } } // get the URL of the next image attachment... if ( $next_id ) $next_attachment_url = get_attachment_link( $next_id ); // or get the URL of the first image attachment. else $next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) ); } } printf( '%3$s', esc_url( $next_attachment_url ), the_title_attribute( array( 'echo' => false ) ), wp_get_attachment_image( $post->ID, $attachment_size ) ); } endif; /** * Return a time difference of a given time in * days, hours or minutes depending on the time * difference. * * @param $time (required) */ function eighties_get_time_difference( $time, $post = 'post' ) { $current_time = new DateTime( current_time( 'mysql' ) ); $previous_time = new DateTime( $time ); $difference = $current_time->diff( $previous_time ); $timestamp = ''; if ( 0 < $difference->y ) { /** * If we've passed one year, let's show the full * date. */ if ( $post === 'comment' ) { $timestamp = get_comment_date( 'F j, Y' ); } else { $timestamp = get_the_date( 'F j, Y' ); } } else if ( 12 >= $difference->m && 1 <= $difference->m ) { /** * If we've made it here, we know that we have not * yet passed one year, but have made it passed one * month. As such, let's remove the year from the * output, but keep the date style format. */ if ( $post === 'comment' ) { $timestamp .= get_comment_date( 'F j' ); } else { $timestamp .= get_the_date( 'F j' ); } } else if ( 0 < $difference->d ) { /** * If we've made it here, we know that we have not * yet passed one month, but have made it passed one * day. As such, let's show just the number of days * that have passed. */ $timestamp .= sprintf( _n( '%s Day Ago', '%s Days Ago', $difference->days, 'eighties' ), $difference->days ); } else if ( 0 < $difference->h ) { /** * If we've made it here, we know that we have not * yet passed one day, but have made it passed one * hour. As such, let's show just the number of hours * that have passed. */ $timestamp .= sprintf( _n( '%s Hour Ago', '%s Hours Ago', $difference->h, 'eighties' ), $difference->h ); } else if ( 0 < $difference->i ) { /** * If we've made it here, we know that we have not * yet passed one hour, but have made it passed one * minute. As such, let's show just the number of * minutes that have passed. */ $timestamp .= sprintf( _n( '%s Minute Ago', '%s Minutes Ago', $difference->i, 'eighties' ), $difference->i ); } else { /** * If we've made it here, that this post is fresh * off the press. Let's show how fresh it is. */ $timestamp = __( 'Just now', 'eighties' ); } return $timestamp; } if ( ! function_exists( 'eighties_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. */ function eighties_posted_on() { /* Date */ $time_string = 'Posted on '; printf( '' . $time_string . '', esc_url( get_permalink() ), esc_attr( eighties_get_time_difference( get_the_date( 'Y-m-d H:i:s' ) ) ), esc_html( eighties_get_time_difference( get_the_date( 'Y-m-d H:i:s' ) ) ) ); /* Author */ printf( ' ' . __( 'by %2$s', 'eighties' ) . '', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ) ); } endif; /** * Returns true if a blog has more than 1 category. * * @return bool */ function eighties_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'eighties_categories' ) ) ) { // Create an array of all the categories that are attached to posts. $all_the_cool_cats = get_categories( array( 'fields' => 'ids', 'hide_empty' => 1, // We only need to know if there is more than one category. 'number' => 2, ) ); // Count the number of categories that are attached to the posts. $all_the_cool_cats = is_countable( $all_the_cool_cats ) ? count( $all_the_cool_cats ) : 0; set_transient( 'eighties_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so _s_categorized_blog should return true. return true; } else { // This blog has only 1 category so _s_categorized_blog should return false. return false; } } /** * Flush out the transients used in eighties_categorized_blog. */ function eighties_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'eighties_categories' ); } add_action( 'edit_category', 'eighties_category_transient_flusher' ); add_action( 'save_post', 'eighties_category_transient_flusher' ); /** * Check the content blob for an