Advertisement
Guest User

Untitled

a guest
Apr 11th, 2015
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.32 KB | None | 0 0
  1. function amplify_posted_on() {
  2.     $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
  3.     if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
  4.         $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
  5.     }
  6.  
  7.     $time_string = sprintf( $time_string,
  8.         esc_attr( get_the_date( 'c' ) ),
  9.         esc_html( get_the_date() ),
  10.         esc_attr( get_the_modified_date( 'c' ) ),
  11.         esc_html( get_the_modified_date() )
  12.     );
  13.  
  14.     $posted_on = sprintf(
  15.         '<i class="fa fa-calendar"></i> %s',
  16.         '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
  17.     );
  18.  
  19.     $byline = sprintf(
  20.         '<i class="fa fa-user"></i> %s',
  21.         '<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_meta('display_name', 1) ) . '</a></span>'
  22.     );
  23.  
  24.     echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';
  25.  
  26.     if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
  27.         echo '<span class="comments-link">';
  28.         comments_popup_link( __( 'Leave a comment', 'amplify' ), __( '1 Comment', 'amplify' ), __( '% Comments', 'amplify' ) );
  29.         echo '</span>';
  30.     }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement