Advertisement
Misplon

Vantage Posted On Custom Musher

Aug 30th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.88 KB | None | 0 0
  1. if ( ! function_exists( 'vantage_posted_on' ) ) :
  2. /**
  3.  * Prints HTML with meta information for the current post-date/time and author.
  4.  *
  5.  * @since vantage 1.0
  6.  */
  7. function vantage_posted_on() {
  8.     $date_time = '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><time class="updated" datetime="%5$s">%6$s</time>';
  9.     $date_time = sprintf( $date_time,
  10.         esc_url( get_permalink() ),
  11.         esc_attr( get_the_time() ),
  12.         esc_attr( get_the_date( 'c' ) ),
  13.         apply_filters('vantage_post_on_date', esc_html( get_the_date() )),
  14.         esc_attr( get_the_modified_date( 'c' ) ),
  15.         esc_html( get_the_modified_date() )
  16.     );
  17.     $author = sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
  18.         esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
  19.         esc_attr( sprintf( __( 'View all posts by %s', 'vantage' ), get_the_author() ) ),
  20.         get_the_author()
  21.     );
  22.     if( ( comments_open() || get_comments_number() ) && !siteorigin_setting('blog_post_date') && !siteorigin_setting('blog_post_author') ) {
  23.         $comments_link = '<span class="comments-link"><a href="' . get_comments_link() . '">' . get_comments_number_text( 'one', 'two', 'three' ) . '</a></span>';
  24.     } elseif( comments_open() || get_comments_number() ) {
  25.         $comments_link = ' | <span class="comments-link"><a href="' . get_comments_link() . '">' . get_comments_number_text( 'one', 'two', 'three' ) . '</a></span>';
  26.     } else {
  27.         $comments_link = '';
  28.     }
  29.     $posted_on_parts = array(
  30.         'on' => sprintf( __( 'Posted on %s', 'vantage'), $date_time ),
  31.         'by' => sprintf( __( '<span class="byline"> by %s</span>', 'vantage' ), $author),
  32.         'with' => $comments_link
  33.     );
  34.     $posted_on_parts = apply_filters( 'vantage_post_on_parts', $posted_on_parts );
  35.     $posted_on = implode(' ', $posted_on_parts);
  36.     echo apply_filters('vantage_posted_on', $posted_on);
  37. }
  38. endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement