1 && get_option( 'page_comments' ) ) : ?> %s', esc_html__( 'Featured', 'amalie-lite' ) ); } $format = get_post_format(); if ( current_theme_supports( 'post-formats', $format ) ) { printf( '%1$s%3$s', sprintf( '%s ', esc_html_x( 'Format', 'Used before post format.', 'amalie-lite' ) ), esc_url( get_post_format_link( $format ) ), get_post_format_string( $format ) ); } if ( 'post' == get_post_type() ) { if ( is_singular() || is_multi_author() ) { printf( '%1$s %3$s', esc_html_x( 'Author', 'Used before post author name.', 'amalie-lite' ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), get_the_author() ); } $categories_list = get_the_category_list( esc_html_x( ', ', 'Used between list items, there is a space after the comma.', 'amalie-lite' ) ); if ( $categories_list && amalie_categorized_blog() ) { printf( '%1$s %2$s', esc_html_x( 'Categories', 'Used before category names.', 'amalie-lite' ), $categories_list ); } $tags_list = get_the_tag_list( '', esc_html_x( ', ', 'Used between list items, there is a space after the comma.', 'amalie-lite' ) ); if ( $tags_list ) { printf( '%1$s %2$s', esc_html_x( 'Tags', 'Used before tag names.', 'amalie-lite' ), $tags_list ); } } if ( is_attachment() && wp_attachment_is_image() ) { // Retrieve attachment metadata. $metadata = wp_get_attachment_metadata(); printf( '%1$s %3$s × %4$s', esc_html_x( 'Full size', 'Used before full size attachment link.', 'amalie-lite' ), esc_url( wp_get_attachment_url() ), $metadata['width'], $metadata['height'] ); } if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; comments_popup_link( esc_html__( 'Leave a comment', 'amalie-lite' ), esc_html__( '1 Comment', 'amalie-lite' ), esc_html__( '% Comments', 'amalie-lite' ) ); echo ''; } } endif; if ( ! function_exists( 'amalie_entry_date' ) ) : /** * Returns HTML with time information for current post */ function amalie_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( esc_html__( 'Permalink to %s', 'amalie-lite' ), the_title_attribute( 'echo=0' ) ) ), $time_string ); } endif; /** * Determine whether blog/site has more than one category. * * @since Amalie 1.0 * * @return bool True of there is more than one category, false otherwise. */ function amalie_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'amalie_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( 'amalie_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so amalie_categorized_blog should return true. return true; } else { // This blog has only 1 category so amalie_categorized_blog should return false. return false; } } /** * Flush out the transients used in {@see amalie_categorized_blog()}. * * @since Amalie 1.0 */ function amalie_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'amalie_categories' ); } add_action( 'edit_category', 'amalie_category_transient_flusher' ); add_action( 'save_post', 'amalie_category_transient_flusher' ); if ( ! function_exists( 'amalie_post_thumbnail' ) ) : /** * Display an optional post thumbnail. * * Wraps the post thumbnail in an anchor element on index views, or a div * element when on single views. * * @since Amalie 1.0 */ function amalie_post_thumbnail() { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() ) : ?>
%2$s', esc_url( get_permalink( get_the_ID() ) ), /* translators: %s: Name of current post */ sprintf( esc_html__( 'Continue reading %s', 'amalie-lite' ), '' . get_the_title( get_the_ID() ) . '' ) ); return ' … ' . $link; } add_filter( 'excerpt_more', 'amalie_excerpt_more' ); endif; /** * Front Page Featured Page */ function amalie_featured_page() { $featured_page_1 = esc_attr( get_theme_mod( 'amalie_featured_page_one_front_page_first_block', '0' ) ); if ( 0 == $featured_page_1 ) { return; } ?>
${'featured_page_' . $page_number}, ); // Create a new WP_Query using the argument previously created $featured_page_query = new WP_Query( $featured_page_args ); ?> have_posts() ) : $featured_page_query->the_post(); ?>