Advertisement
pratikshrestha

Catch Responsive: Edit Meta

Mar 22nd, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.79 KB | None | 0 0
  1. /**
  2.  * Prints HTML with meta information for the current post-date/time and author.
  3.  *
  4.  * @since Catch Responsive 1.0
  5.  */
  6. function catchresponsive_entry_meta() {
  7.     echo '<p class="entry-meta">';
  8.  
  9.     $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
  10.  
  11.     if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
  12.         $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
  13.     }
  14.  
  15.     $time_string = sprintf( $time_string,
  16.         esc_attr( get_the_date( 'c' ) ),
  17.         esc_html( get_the_date() ),
  18.         esc_attr( get_the_modified_date( 'c' ) ),
  19.         esc_html( get_the_modified_date() )
  20.     );
  21.  
  22.     printf( '<span class="posted-on">%1$s<a href="%2$s" rel="bookmark">%3$s</a></span>',
  23.         sprintf( _x( '<span class="screen-reader-text">Posted on</span>', 'Used before publish date.', 'catch-responsive' ) ),
  24.         esc_url( get_permalink() ),
  25.         $time_string
  26.     );
  27.  
  28.     if ( is_singular() || is_multi_author() ) {
  29.         printf( '<span class="byline"><span class="author vcard">%1$s<a class="url fn n" href="%2$s">%3$s</a></span></span>',
  30.             sprintf( _x( '<span class="screen-reader-text">Author</span>', 'Used before post author name.', 'catch-responsive' ) ),
  31.             esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
  32.             esc_html( get_the_author() )
  33.         );
  34.     }
  35.  
  36.     if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) {
  37.         echo '<span class="comments-link">';
  38.         comments_popup_link( esc_html__( 'Leave a comment', 'catch-responsive' ), esc_html__( '1 Comment', 'catch-responsive' ), esc_html__( '% Comments', 'catch-responsive' ) );
  39.         echo '</span>';
  40.     }
  41.  
  42.     edit_post_link( esc_html__( 'Edit', 'catch-responsive' ), '<span class="edit-link">', '</span>' );
  43.  
  44.     echo '</p><!-- .entry-meta -->';
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement