%2$s'; 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() ) ); echo '' . $time_string . ''; // WPCS: XSS OK. } if ( ! function_exists( 'digimag_lite_posted_by' ) ) : /** * Prints HTML with meta information for the current author. * * @param bool $text whether to print string Posted by. */ function digimag_lite_posted_by( $text = 'default' ) { if ( 'default' === $text ) { $text = esc_html__( 'Posted by: ', 'digimag-lite' ); } elseif ( false === $text ) { $text = ''; } $byline = sprintf( /* translators: %s: post author. */ esc_html_x( '%1$s%2$s', 'post author', 'digimag-lite' ), esc_html( $text ), '' . esc_html( get_the_author() ) . '' ); echo ' ' . $byline . ''; // WPCS: XSS OK. } endif; /** * Prints HTML with meta information for the comment number. */ function digimag_lite_print_comment_link() { $comment_number = get_comments_number(); if ( in_the_loop() && ! is_single() && ! $comment_number ) { return; } if ( ! post_password_required() && ( comments_open() || $comment_number ) ) { $comment_number_output = '' . $comment_number; echo ''; comments_popup_link( $comment_number_output, $comment_number_output, $comment_number_output ); echo ''; } } /** * Get single category * * @param boolean $has_background background or not. */ function digimag_lite_print_single_category( $has_background = false ) { $categories = get_the_category(); $link = get_category_link( $categories[0]->term_id ); $name = $categories[0]->name; $color = get_term_meta( $categories[0]->term_id, 'category_color', true ); $html = ''; $background = ''; if ( ! empty( $color ) && ! $has_background ) { $html = ''; } elseif ( ! empty( $color ) && $has_background ) { $background = 'style="background-color:' . esc_attr( $color ) . '"'; } printf( ' %s %s ', wp_kses_post( $background ), wp_kses_post( $html ), esc_url( $link ), esc_html( $name ) ); } /** * Prints HTML with meta information for the categories. */ function digimag_lite_print_categories_list() { $categories_list = get_the_category_list( esc_html__( ', ', 'digimag-lite' ) ); if ( $categories_list ) { printf( '%s', wp_kses_post( $categories_list ) ); } } if ( ! function_exists( 'digimag_lite_entry_footer' ) ) : /** * Prints HTML with meta information for the tags and comments. */ function digimag_lite_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 */ $tags_list = get_the_tag_list(); if ( $tags_list ) { /* translators: 1: list of tags. */ printf( '' . esc_html__( 'Tags: %1$s', 'digimag-lite' ) . '', $tags_list ); // WPCS: XSS OK. } } digimag_lite_edit_link(); } endif; /** * Edit Link. */ function digimag_lite_edit_link() { edit_post_link( sprintf( wp_kses( /* translators: %s: Name of current post. Only visible to screen readers */ __( 'Edit %s', 'digimag-lite' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ), '', '' ); } /** * Footer Widgets Area */ function digimag_lite_footer_widget_area() { if ( ! is_active_sidebar( 'footer1' ) && ! is_active_sidebar( 'footer2' ) && ! is_active_sidebar( 'footer3' ) ) { return; } ?> '; $permalink .= ''; /* translators: permalink. */ printf( '
' . __( 'Permalink: %s', 'digimag-lite' ) . '
', $permalink ); // WP XSS: OK. } if ( ! function_exists( 'digimag_lite_post_thumbnail' ) ) : /** * Displays an optional post thumbnail. * * Wraps the post thumbnail in an anchor element on index views, or a div * element when on single views. * * @param string|array $size thumbnail size. */ function digimag_lite_post_thumbnail( $size = 'post-thumbnail' ) { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() && ! is_front_page() ) : ?>
%s', esc_url( $author_website ), esc_html__( "visit author's website", 'digimag-lite' ) ); } if ( empty( $output ) ) { return ''; } echo ''; } /** * Author Box. */ function digimag_lite_author_box() { ?>

' . get_the_author() . '' ); ?>

get_next_post(), 'prev_text' => get_previous_post(), ); foreach ( $navigation_posts as $key => $navigation_post ) { if ( ! empty( $navigation_post ) ) { $text = ''; $meta_nav = 'next_text' === $key ? __( 'Next Post', 'digimag-lite' ) : __( 'Previous Post', 'digimag-lite' ); $title = wp_trim_words( get_the_title( $navigation_post->ID ), $title_length ); $categories = get_the_category( $navigation_post->ID ); $cat_color = get_term_meta( $categories[0]->term_id, 'category_color', true ); $style = $cat_color ? 'style="background-color:' . esc_attr( $cat_color ) . '"' : ''; $thumbnail = has_post_thumbnail( $navigation_post->ID ) ? get_the_post_thumbnail( $navigation_post->ID, 'post-thumbnail' ) : ''; $text = sprintf( '
%3$s

%4$s

%5$s', $meta_nav, $style, $categories[0]->name, $title, $thumbnail ); } $navigation_posts[ $key ] = ! empty( $text ) ? $text : ''; } the_post_navigation( $navigation_posts ); }