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

    ', '' ); ?> 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '', 'after' => '', ) ) ); ?>
    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; if ( ! function_exists( 'sela_entry_meta' ) ) : /** * Prints HTML with meta information for current post: categories, tags, permalink, author, and date. */ function sela_entry_meta() { // Sticky if ( is_sticky() && is_home() && ! is_paged() ) { echo '' . __( 'Featured', 'sela' ) . ''; } // Date if ( ! is_sticky() ) { sela_entry_date(); } // Comments if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; comments_popup_link( __( 'Leave a comment', 'sela' ), __( '1 Comment', 'sela' ), __( '% Comments', 'sela' ) ); echo ''; } // Edit link edit_post_link( __( 'Edit', 'sela' ), '', '' ); } endif; if ( ! function_exists( 'sela_entry_date' ) ) : /** * Returns HTML with time information for current post */ function sela_entry_date() { $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( '%3$s', esc_url( get_permalink() ), esc_attr( sprintf( __( 'Permalink to %s', 'sela' ), the_title_attribute( 'echo=0' ) ) ), $time_string ); } endif; /** * Return the first link found in the post content or fall back to permalink. */ if ( ! function_exists( 'sela_get_link_url' ) ) : function sela_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() ); } endif; // sela_get_link_url /** * Returns true if a blog has more than 1 category */ function sela_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'sela_category_count' ) ) ) { // 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( 'sela_category_count', $all_the_cool_cats ); } if ( '1' != $all_the_cool_cats ) { // This blog has more than 1 category so sela_categorized_blog should return true return true; } else { // This blog has only 1 category so sela_categorized_blog should return false return false; } } /** * Flush out the transients used in sela_categorized_blog */ function sela_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'sela_category_count' ); } add_action( 'edit_category', 'sela_category_transient_flusher' ); add_action( 'save_post', 'sela_category_transient_flusher' ); /** * Display an optional post thumbnail. * * Wraps the post thumbnail in an anchor element on index * views, or a div element when on single views. * */ function sela_post_thumbnail() { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() ) : ?>
    ' . esc_html__( 'Tagged: %2$s', 'sela' ) . ''; } else { $meta_text = __( 'Permalink.', 'sela' ); } } else { // But this blog has loads of categories so we should probably display them here if ( '' != $tag_list && ! is_wp_error( $tag_list ) ) { $meta_text = '' . esc_html__( 'Posted in: %1$s', 'sela' ) . ' | ' . esc_html__( 'Tagged: %2$s', 'sela' ) . ''; } else { $meta_text = '' . esc_html__( 'Posted in: %1$s', 'sela' ) . ''; } } // end check for categories on this blog // If $tag_list contains WP Error, empty before passing to printf() if ( is_wp_error( $tag_list ) ) { $tag_list = ''; } printf( $meta_text, $category_list, $tag_list, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ) ); } endif; /** * Add custom header image to header area */ function sela_header_background() { if ( get_header_image() ) { $css = '.site-branding { background-image: url(' . esc_url( get_header_image() ) . '); }'; wp_add_inline_style( 'sela-style', $css ); } } add_action( 'wp_enqueue_scripts', 'sela_header_background', 11 ); function sela_jp_testimonials_content() { $jetpack_options = get_theme_mod( 'jetpack_testimonials' ); if ( isset( $jetpack_options['page-content'] ) && '' != $jetpack_options['page-content'] ) : ?>
    ' . get_the_author() . '' ); } elseif ( is_year() ) { $title = sprintf( __( 'Year: %s', 'sela' ), get_the_date( _x( 'Y', 'yearly archives date format', 'sela' ) ) ); } elseif ( is_month() ) { $title = sprintf( __( 'Month: %s', 'sela' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'sela' ) ) ); } elseif ( is_day() ) { $title = sprintf( __( 'Day: %s', 'sela' ), get_the_date( _x( 'F j, Y', 'daily archives date format', 'sela' ) ) ); } elseif ( is_tax( 'post_format' ) ) { if ( is_tax( 'post_format', 'post-format-aside' ) ) { $title = _x( 'Asides', 'post format archive title', 'sela' ); } elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) { $title = _x( 'Galleries', 'post format archive title', 'sela' ); } elseif ( is_tax( 'post_format', 'post-format-image' ) ) { $title = _x( 'Images', 'post format archive title', 'sela' ); } elseif ( is_tax( 'post_format', 'post-format-video' ) ) { $title = _x( 'Videos', 'post format archive title', 'sela' ); } elseif ( is_tax( 'post_format', 'post-format-quote' ) ) { $title = _x( 'Quotes', 'post format archive title', 'sela' ); } elseif ( is_tax( 'post_format', 'post-format-link' ) ) { $title = _x( 'Links', 'post format archive title', 'sela' ); } elseif ( is_tax( 'post_format', 'post-format-status' ) ) { $title = _x( 'Statuses', 'post format archive title', 'sela' ); } elseif ( is_tax( 'post_format', 'post-format-audio' ) ) { $title = _x( 'Audio', 'post format archive title', 'sela' ); } elseif ( is_tax( 'post_format', 'post-format-chat' ) ) { $title = _x( 'Chats', 'post format archive title', 'sela' ); } } elseif ( is_post_type_archive() ) { $title = sprintf( __( 'Archives: %s', 'sela' ), post_type_archive_title( '', false ) ); } elseif ( is_tax() ) { $tax = get_taxonomy( get_queried_object()->taxonomy ); /* translators: 1: Taxonomy singular name, 2: Current taxonomy term */ $title = sprintf( __( '%1$s: %2$s', 'sela' ), $tax->labels->singular_name, single_term_title( '', false ) ); } else { $title = __( 'Archives', 'sela' ); } /** * Filter the archive title. * * @param string $title Archive title to be displayed. */ $title = apply_filters( 'get_the_archive_title', $title ); if ( ! empty( $title ) ) { echo $before . $title . $after; } } endif; if ( ! function_exists( 'the_archive_description' ) ) : /** * Shim for `the_archive_description()`. * * Display category, tag, or term description. * * @todo Remove this function when WordPress 4.3 is released. * */ function the_archive_description( $before = '', $after = '' ) { $description = apply_filters( 'get_the_archive_description', term_description() ); if ( ! empty( $description ) ) { /** * Filter the archive description. * * @see term_description() * * @param string $description Archive description to be displayed. */ echo $before . $description . $after; } } endif;