/**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function materialwp_posted_on()
 {
     $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')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
     $posted_on = sprintf(_x('<i class="mdi-action-schedule"></i> %s', 'post date', 'materialwp'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
     $byline = sprintf(_x('<i class="mdi-action-account-circle"></i> %s', 'post author', 'materialwp'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
     echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';
     if ('post' == get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(__(', ', 'materialwp'));
         if ($categories_list && materialwp_categorized_blog()) {
             printf('<span class="cat-links">' . __('<i class="mdi-file-folder-open"></i> %1$s', 'materialwp') . '</span>', $categories_list);
         }
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link"><i class="mdi-action-question-answer"></i> ';
         comments_popup_link(__('Leave a comment', 'materialwp'), __('1 Comment', 'materialwp'), __('% Comments', 'materialwp'));
         echo '</span>';
     }
 }
示例#2
0
						<div class="page-content">
							<p><?php 
_e('It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'materialwp');
?>
</p>

							<?php 
get_search_form();
?>

							<?php 
the_widget('WP_Widget_Recent_Posts');
?>

							<?php 
if (materialwp_categorized_blog()) {
    // Only show the widget if site has multiple categories.
    ?>
							<div class="widget widget_categories">
								<h2 class="widget-title"><?php 
    _e('Most Used Categories', 'materialwp');
    ?>
</h2>
								<ul>
								<?php 
    wp_list_categories(array('orderby' => 'count', 'order' => 'DESC', 'show_count' => 1, 'title_li' => '', 'number' => 10));
    ?>
								</ul>
							</div><!-- .widget -->
							<?php 
}