%2$s'; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string = ''; } $time_string = sprintf($time_string, esc_attr(get_the_date(DATE_W3C)), esc_html(get_the_date()), esc_attr(get_the_modified_date(DATE_W3C)), esc_html(get_the_modified_date()) ); $year = get_the_date('Y'); $month = get_the_date('m'); $day = get_the_date('d'); $link = get_day_link($year, $month, $day); $posted_on = '' . $time_string . ''; echo '
'; echo '
'; echo '' . $posted_on . ''; // WPCS: XSS OK. echo '
'; echo '
'; } } endif; if( !function_exists('alok_posted_by') ) : /** * Prints HTML with meta information for the current author. */ function alok_posted_by(){ $alok_default = alok_get_default_theme_options(); $ed_post_author = absint( get_theme_mod( 'ed_post_author',$alok_default['ed_post_author'] ) ); if( $ed_post_author ){ echo '
'; $byline = '' . esc_html(get_the_author()) . ''; echo '
' . $byline . '
'; alok_posted_on(); echo '
'; } } endif; if( !function_exists('alok_entry_footer') ): /** * Prints HTML with meta information for the categories, tags and comments. */ function alok_entry_footer( $cats = true, $tags = true, $edits = true ){ $alok_default = alok_get_default_theme_options(); $ed_post_category = absint( get_theme_mod( 'ed_post_category',$alok_default['ed_post_category'] ) ); $ed_post_tags = absint( get_theme_mod( 'ed_post_tags',$alok_default['ed_post_tags'] ) ); // Hide category and tag text for pages. if( 'post' === get_post_type() ){ if( $cats && $ed_post_category ){ /* translators: used between list items, there is a space after the comma */ $categories = get_the_category(); echo '
'; echo '
'; /* translators: 1: list of categories. */ echo ''; foreach( $categories as $category ){ $cat_name = $category->name; $cat_slug = $category->slug; $cat_url = get_category_link( $category->term_id ); ?> '; echo '
'; echo '
'; } if( $tags && $ed_post_tags ){ /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list('', esc_html_x(', ', 'list item separator', 'alok')); if( $tags_list ){ echo '
'; echo '
'; echo ''; echo ''; /* translators: 1: list of tags. */ echo ''; echo wp_kses_post($tags_list) . ''; // WPCS: XSS OK. echo '
'; echo '
'; } } if( $edits ){ edit_post_link( sprintf( wp_kses( /* translators: %s: Name of current post. Only visible to screen readers */ __('Edit %s', 'alok'), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ), '', '' ); } } } endif; if( !function_exists('alok_is_comment_by_post_author') ): /** * Comments */ /** * Check if the specified comment is written by the author of the post commented on. * * @param object $comment Comment data. * * @return bool */ function alok_is_comment_by_post_author( $comment = null ){ if( is_object($comment) && $comment->user_id > 0 ){ $user = get_userdata($comment->user_id); $post = get_post($comment->comment_post_ID); if (!empty($user) && !empty($post)) { return $comment->user_id === $post->post_author; } } return false; } endif; add_filter( 'get_the_archive_title','alok_archive_title_callback'); if( !function_exists('alok_archive_title_callback') ) : /** * Alok Archive title filter */ function alok_archive_title_callback($comment = null){ $title = ''; if ( is_category() ) { $title = single_cat_title( '', false ); } elseif ( is_tag() ) { $title = single_tag_title( '', false ); } elseif ( is_author() ) { $title = get_the_author(); } elseif ( is_year() ) { $title = get_the_date( 'Y' ); } elseif ( is_month() ) { $title = get_the_date( 'F Y' ); } elseif ( is_day() ) { $title = get_the_date( 'F j, Y' ); } elseif ( is_post_type_archive() ) { $title = post_type_archive_title( '', false ); } elseif ( is_tax() ) { $title = single_term_title( '', false ); } return $title; } endif; if( !function_exists('alok_archive_title') ) : /** * Alok Archive Title */ function alok_archive_title($comment = null){ if( is_search() ){ ?>