/** * Prints HTML with meta information for the categories, tags. * * @since Twenty Fifteen 1.0 */ function theme_entry_meta() { if (is_sticky() && is_home() && !is_paged()) { printf('<span class="sticky-post">%s</span>', __('Featured', 'twentyfifteen')); } $format = get_post_format(); if (current_theme_supports('post-formats', $format)) { printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'twentyfifteen')), esc_url(get_post_format_link($format)), get_post_format_string($format)); } if (in_array(get_post_type(), array('post', 'attachment'))) { $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; } $time_string = sprintf($time_string, esc_attr(get_the_date('c')), get_the_date(), esc_attr(get_the_modified_date('c')), get_the_modified_date()); printf('<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', _x('Posted on', 'Used before publish date.', 'twentyfifteen'), esc_url(get_permalink()), $time_string); } if ('post' == get_post_type()) { if (is_singular() || is_multi_author()) { printf('<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', _x('Author', 'Used before post author name.', 'twentyfifteen'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author()); } $categories_list = get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen')); if ($categories_list && theme_categorized_blog()) { printf('<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Categories', 'Used before category names.', 'twentyfifteen'), $categories_list); } $tags_list = get_the_tag_list('', _x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen')); if ($tags_list) { printf('<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Tags', 'Used before tag names.', 'twentyfifteen'), $tags_list); } } if (is_attachment() && wp_attachment_is_image()) { // Retrieve attachment metadata. $metadata = wp_get_attachment_metadata(); printf('<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s × %4$s</a></span>', _x('Full size', 'Used before full size attachment link.', 'twentyfifteen'), esc_url(wp_get_attachment_url()), $metadata['width'], $metadata['height']); } if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) { echo '<span class="comments-link">'; comments_popup_link(__('Leave a comment', 'twentyfifteen'), __('1 Comment', 'twentyfifteen'), __('% Comments', 'twentyfifteen')); echo '</span>'; } }
/** * Prints HTML with meta information for the categories, tags and comments. */ function theme_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__(', ', 'theme')); if ($categories_list && theme_categorized_blog()) { printf('<span class="cat-links">' . esc_html__('Posted in %1$s', 'theme') . '</span>', $categories_list); // WPCS: XSS OK. } /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list('', esc_html__(', ', 'theme')); if ($tags_list) { printf('<span class="tags-links">' . esc_html__('Tagged %1$s', 'theme') . '</span>', $tags_list); // WPCS: XSS OK. } } if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) { echo '<span class="comments-link">'; comments_popup_link(esc_html__('Leave a comment', 'theme'), esc_html__('1 Comment', 'theme'), esc_html__('% Comments', 'theme')); echo '</span>'; } edit_post_link(sprintf(esc_html__('Edit %s', 'theme'), the_title('<span class="screen-reader-text">"', '"</span>', false)), '<span class="edit-link">', '</span>'); }
wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'test-theme'), 'after' => '</div>')); ?> </div><!-- .entry-content --> <?php } ?> <footer class="entry-meta"> <?php if ('post' == get_post_type()) { // Hide category and tag text for pages on Search ?> <?php /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list(__(', ', 'test-theme')); if ($categories_list && theme_categorized_blog()) { ?> <span class="cat-links"> <?php printf(__('Posted in %1$s', 'test-theme'), $categories_list); ?> </span> <?php } // End if categories ?> <?php /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list('', __(', ', 'test-theme')); if ($tags_list) {
<div class="page-content"> <p><?php esc_html_e('It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'theme'); ?> </p> <?php get_search_form(); ?> <?php the_widget('WP_Widget_Recent_Posts'); ?> <?php if (theme_categorized_blog()) { // Only show the widget if site has multiple categories. ?> <div class="widget widget_categories"> <h2 class="widget-title"><?php esc_html_e('Most Used Categories', 'theme'); ?> </h2> <ul> <?php wp_list_categories(array('orderby' => 'count', 'order' => 'DESC', 'show_count' => 1, 'title_li' => '', 'number' => 10)); ?> </ul> </div><!-- .widget --> <?php }