' . get_the_title() . '' ); $more = sprintf( '%s', get_permalink(), $text ); return $excerpt . $more; } //add_filter( 'the_excerpt', 'trifold_the_excerpt' ); if ( ! function_exists( 'trifold_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. */ function trifold_posted_on() { $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() ) ); $posted_on = sprintf( esc_html_x( 'Posted on %s', 'post date', 'trifold' ), '' . $time_string . '' ); $byline = sprintf( esc_html_x( 'by %s', 'post author', 'trifold' ), ' ' ); echo '' . $posted_on . ' '; // WPCS: XSS OK. } endif; if ( ! function_exists( 'trifold_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function trifold_entry_footer() { // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( '/', 'trifold' ) ); if ( $categories_list && trifold_categorized_blog() ) { printf( '' . esc_html__( 'in %1$s', 'trifold' ) . '', $categories_list ); // WPCS: XSS OK. } } if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; comments_popup_link( esc_html__( '0 Comments', 'trifold' ), esc_html__( '1 Comment', 'trifold' ), esc_html__( '% Comments', 'trifold' ) ); echo ''; } } endif; /** * Returns true if a blog has more than 1 category. * * @return bool */ function trifold_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'trifold_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 = count( $all_the_cool_cats ); set_transient( 'trifold_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so trifold_categorized_blog should return true. return true; } else { // This blog has only 1 category so trifold_categorized_blog should return false. return false; } } /** * Flush out the transients used in trifold_categorized_blog. */ function trifold_category_transient_flusher() { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } // Like, beat it. Dig? delete_transient( 'trifold_categories' ); } add_action( 'edit_category', 'trifold_category_transient_flusher' ); add_action( 'save_post', 'trifold_category_transient_flusher' ); /** * Get the pagination * * @since 1.0.0 */ function trifold_post_pagination() { $type = get_theme_mod( 'pagination-type', trifold_get_default( 'pagination-type' ) ); switch ( $type ) { case 'numeric': trifold_numeric_posts_nav(); break; default: trifold_standard_posts_nav(); break; } } if( ! function_exists( 'trifold_standard_posts_nav' ) ) : /** * Add custom standard pagination * @return void */ function trifold_standard_posts_nav() { global $wp_query; if( $wp_query->max_num_pages > 1 ) : ?>