now outputting the post meta information from a function (similar to twentyeleven)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php // https://github.com/retlehs/roots/wiki
|
||||
|
||||
require_once get_template_directory() . '/inc/roots-activation.php'; // activation
|
||||
require_once get_template_directory() . '/inc/roots-options.php'; // theme options
|
||||
@@ -76,4 +76,10 @@ foreach ($sidebars as $sidebar) {
|
||||
));
|
||||
}
|
||||
|
||||
// return post entry meta information
|
||||
function roots_entry_meta() {
|
||||
echo '<time class="updated" datetime="'. get_the_time('c') .'" pubdate>'. sprintf(__('Posted on %s at %s.', 'roots'), get_the_time('l, F jS, Y'), get_the_time()) .'</time>';
|
||||
echo '<p class="byline author vcard">'. __('Written by', 'roots') .' <a href="'. get_author_posts_url(get_the_author_meta('id')) .'" rel="author" class="fn">'. get_the_author() .'</a></p>';
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -13,8 +13,7 @@
|
||||
<?php roots_post_inside_before(); ?>
|
||||
<header>
|
||||
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
|
||||
<time pubdate datetime="<?php the_time('c'); ?>"><?php printf(__('Posted on %s at %s.', 'roots'), get_the_time('l, F jS, Y'), get_the_time()); ?></time>
|
||||
<p class="byline author vcard"><?php _e('Written by', 'roots'); ?> <?php the_author_posts_link(); ?></p>
|
||||
<?php roots_entry_meta(); ?>
|
||||
</header>
|
||||
<div class="entry-content">
|
||||
<?php the_excerpt(); ?>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<?php roots_post_inside_before(); ?>
|
||||
<header>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
<time class="updated" datetime="<?php the_time('c'); ?>" pubdate><?php printf(__('Posted on %s at %s.', 'roots'), get_the_time('l, F jS, Y'),get_the_time())?></time>
|
||||
<p class="byline author vcard"><?php _e('Written by', 'roots'); ?> <?php the_author_posts_link(); ?></p> </header>
|
||||
<?php roots_entry_meta(); ?>
|
||||
</header>
|
||||
<div class="entry-content">
|
||||
<?php the_content(); ?>
|
||||
</div>
|
||||
|
||||
3
loop.php
3
loop.php
@@ -13,8 +13,7 @@
|
||||
<?php roots_post_inside_before(); ?>
|
||||
<header>
|
||||
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
|
||||
<time pubdate datetime="<?php the_time('c'); ?>"><?php printf( __('Posted on %s at %s.','roots'), get_the_time('l, F jS, Y'), get_the_time()) ?></time>
|
||||
<p class="byline author vcard"><?php _e('Written by', 'roots'); ?> <?php the_author_posts_link(); ?></p>
|
||||
<?php roots_entry_meta(); ?>
|
||||
</header>
|
||||
<div class="entry-content">
|
||||
<?php if (is_archive() || is_search()) : // Only display excerpts for archives and search ?>
|
||||
|
||||
Reference in New Issue
Block a user