Skip to content

Commit

Permalink
Adiciona the_post() e rewind_posts() para permitir utilizar get_the_a…
Browse files Browse the repository at this point in the history
…uthor() e get_the_author_meta() fora do loop
  • Loading branch information
leobaiano committed Jun 8, 2019
1 parent 4750e2b commit e2fa2e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ function coletivo_site_header(){
*/
function coletivo_posted_on()
{
the_post();

$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 hide" datetime="%3$s">%4$s</time>';
Expand All @@ -115,6 +117,7 @@ function coletivo_posted_on()

echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK.

rewind_posts();
}
}

Expand Down

0 comments on commit e2fa2e6

Please sign in to comment.