max_num_pages < 2 ) { return; } ?> post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?> %2$s', esc_url( get_post_format_link( $format ) ), get_post_format_string( $format ) ); } /* Date */ $time_string = 'Posted on '; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string .= ''; } printf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); /* Author */ printf( ' ', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ) ); /* Permalink */ printf( '∞', esc_url( get_permalink() ) ); } endif; if ( ! function_exists( 'bosco_post_meta' ) ) : /** * Prints HTML with the post format, date/time, author and permalink for the current post. */ function bosco_post_meta() { // Post Format $format = get_post_format(); $supported_formats = get_theme_support( 'post-formats' ); if ( $format && has_post_format( $supported_formats[0] ) ) { printf( '%2$s', esc_url( get_post_format_link( $format ) ), get_post_format_string( $format ) ); } // Date and Permalink $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string .= ''; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); printf( __( 'Posted on %1$s ', 'bosco' ), sprintf( '%2$s', esc_url( get_permalink() ), $time_string ), sprintf( ' ', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ) ) ); } endif; if ( ! function_exists( 'bosco_categories_tags' ) ) : /** * Prints HTML with the categories and tags for the current post. */ function bosco_categories_tags() { $categories_tags = ''; /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( __( ', ', 'bosco' ) ); /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', __( ', ', 'bosco' ) ); // Don't print anything if there's only 1 category and no tags. if ( bosco_categorized_blog() || $tags_list ) : ?>
$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, 'full' ) ); } endif; /** * Uses get_url_in_content() to get the URL of the first link found in the post content. * Falls back to the post permalink if no URL is found in the post. */ function bosco_get_link_url() { $content = get_the_content(); $has_url = get_url_in_content( $content ); return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); } /** * Replaces "[...]" (appended to automatically generated excerpts) with a Continue reading link. * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. */ if ( ! function_exists( 'bosco_excerpt_more' ) ) : function bosco_excerpt_more( $more ) { return sprintf( ' %2$s', esc_url( get_permalink( get_the_ID() ) ), sprintf( __( 'Continue reading %s', 'bosco' ), '' . get_the_title( get_the_ID() ) . ' ' ) ); } add_filter( 'excerpt_more', 'bosco_excerpt_more' ); endif;