post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; } // Don't print empty markup in archives if there's only one page. if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) return; $nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation'; ?> comment_type || 'trackback' == $comment->comment_type ) : ?>
  • >
    ', '' ); ?>
  • >
    %s', get_comment_author_link() ); ?>
    comment_approved ) : ?>

    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' => 999, '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; /** * Returns true if a blog has more than 1 category */ function writr_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 = is_countable( $all_the_cool_cats ) ? count( $all_the_cool_cats ) : 0; set_transient( 'all_the_cool_cats', $all_the_cool_cats ); } if ( '1' != $all_the_cool_cats ) { // This blog has more than 1 category so writr_categorized_blog should return true return true; } else { // This blog has only 1 category so writr_categorized_blog should return false return false; } } /** * Flush out the transients used in writr_categorized_blog */ function writr_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'all_the_cool_cats' ); } add_action( 'edit_category', 'writr_category_transient_flusher' ); add_action( 'save_post', 'writr_category_transient_flusher' ); if ( ! function_exists( 'writr_meta' ) ) : /** * Prints HTML with meta information for the date, author, categories, tags and comments */ function writr_meta() { ?>
  • ', '' ); } endif; if ( ! function_exists( 'writr_eventbrite_event_meta' ) ) : /** * Output Eventbrite event information such as date, time, venue, and organizer */ function writr_eventbrite_event_meta() { // Start with the event time. $time = sprintf( '
  • %s%s
  • ', esc_html__( 'Event date and time', 'writr' ), eventbrite_event_time() ); // Add a venue name if available. $venue = ''; if ( ! empty( eventbrite_event_venue()->name ) ) { $venue = sprintf( '
  • %s%s
  • ', esc_html__( 'Venue', 'writr' ), esc_url( eventbrite_venue_get_archive_link() ), esc_html( eventbrite_event_venue()->name ) ); } // Add the organizer's name if available. Author-related functions are filtered to use the event's organizer. $organizer = ''; if ( ! empty( eventbrite_event_organizer()->name ) ) { $organizer = sprintf( '
  • %s%s
  • ', esc_html__( 'Organizer', 'writr' ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ) ); } // Add a contextual link to event details. if ( eventbrite_is_single() ) { // Link to event info on eventbrite.com. $url = add_query_arg( array( 'ref' => 'wporglink' ), eventbrite_event_eb_url() ); } else { // Link to the event single view. $url = get_the_permalink(); } $details = sprintf( '
  • %s
  • ', esc_url( $url ), esc_html__( 'Details', 'writr' ) ); // Add an event Edit link. $edit = ''; if ( current_user_can( 'edit_posts' ) ) { $url = add_query_arg( array( 'eid' => get_the_ID(), 'ref' => 'wporgedit', ), 'https://eventbrite.com/edit' ); $edit = sprintf( '
  • %s
  • ', esc_url( $url ), esc_html__( 'Edit', 'writr' ) ); } // Assemble our HTML. Yugly. $html = sprintf( '', $time, $venue, $organizer, $details, $edit ); echo apply_filters( 'eventbrite_event_meta', $html, $time, $venue, $organizer, $details, $edit ); } endif;