now outputting the post meta information from a function (similar to twentyeleven)

This commit is contained in:
Ben Word
2011-09-21 19:35:20 -06:00
parent 4a99d5bcd4
commit 5555709aa5
4 changed files with 11 additions and 7 deletions

View File

@@ -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-activation.php'; // activation
require_once get_template_directory() . '/inc/roots-options.php'; // theme options 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>';
}
?> ?>

View File

@@ -13,8 +13,7 @@
<?php roots_post_inside_before(); ?> <?php roots_post_inside_before(); ?>
<header> <header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <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> <?php roots_entry_meta(); ?>
<p class="byline author vcard"><?php _e('Written by', 'roots'); ?> <?php the_author_posts_link(); ?></p>
</header> </header>
<div class="entry-content"> <div class="entry-content">
<?php the_excerpt(); ?> <?php the_excerpt(); ?>

View File

@@ -5,8 +5,8 @@
<?php roots_post_inside_before(); ?> <?php roots_post_inside_before(); ?>
<header> <header>
<h1 class="entry-title"><?php the_title(); ?></h1> <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> <?php roots_entry_meta(); ?>
<p class="byline author vcard"><?php _e('Written by', 'roots'); ?> <?php the_author_posts_link(); ?></p> </header> </header>
<div class="entry-content"> <div class="entry-content">
<?php the_content(); ?> <?php the_content(); ?>
</div> </div>

View File

@@ -13,8 +13,7 @@
<?php roots_post_inside_before(); ?> <?php roots_post_inside_before(); ?>
<header> <header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <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> <?php roots_entry_meta(); ?>
<p class="byline author vcard"><?php _e('Written by', 'roots'); ?> <?php the_author_posts_link(); ?></p>
</header> </header>
<div class="entry-content"> <div class="entry-content">
<?php if (is_archive() || is_search()) : // Only display excerpts for archives and search ?> <?php if (is_archive() || is_search()) : // Only display excerpts for archives and search ?>