/** * Prints HTML with meta information for the current post-date/time and author. * * @since 1.0.0 */ function gomedia_posted_on() { global $post; $time_string = __('<time class="entry-date published" datetime="%1$s">%2$s ago</time>', 'gomedia'); $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(human_time_diff(get_the_time('U'), current_time('timestamp')))); printf(__('<span class="posted-on">%1$s</span><span class="byline"> by %2$s</span>', 'gomedia'), sprintf('<a href="%1$s" rel="bookmark">%2$s</a>', esc_url(get_permalink()), $time_string), sprintf('<span class="author vcard entry-author"><a class="url fn n" href="%1$s">%2$s</a></span>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_html(get_the_author()))); $category = get_the_category($post->ID); if ($category && gomedia_categorized_blog() && !is_single()) { echo '<span class="entry-category">'; echo '<a href="' . get_category_link($category[0]->term_id) . '">' . $category[0]->name . '</a>'; echo '</span>'; } // End if categories }
<?php the_title('<h1 class="entry-title">', '</h1>'); ?> <div class="entry-meta"> <time class="entry-date published" datetime="<?php echo get_the_date('c'); ?> "><?php printf(__('Posted on %s', 'gomedia'), esc_html(get_the_date())); ?> </time> <?php /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list(__(', ', 'gomedia')); if ($categories_list && gomedia_categorized_blog()) { ?> <span class="cat-links"> <?php printf(__('in %1$s', 'gomedia'), $categories_list); ?> </span> <?php } // End if categories ?> <?php edit_post_link(__('· Edit', 'gomedia'), '<span class="edit-link">', '</span>'); ?> </div><!-- .entry-meta --> </header><!-- .entry-header -->