SHARE
TWEET

Date and Byline under title

a guest Dec 16th, 2012 308 Never
  1. Here is the function I'm trying:
  2.  
  3. function abyline_posted_on() {
  4.         $link= esc_url( get_permalink() );
  5.         $title= esc_attr( get_the_title() );
  6.         $time= esc_attr( get_the_time() );
  7.         $dateGMT= esc_attr( get_the_date( 'c' ) );
  8.         $date= esc_html( get_the_date() );
  9.         $authorURL= esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) );
  10.         $author= esc_html( get_the_author() );
  11.         echo ('<span class="sep">Posted on</span> <a href="'.$link.'" title="'.$title.'" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>'.$date.' at '. $time.'</time></a> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="'.$authorURL.'" title="'.$author.'" rel="author">'.$author.'</a></span>');
  12.     }
  13.  
  14. Here is the call I put in my content.php file
  15.  
  16. <?php if ( 'post' == get_post_type() ) : ?>
  17.         <div class="entry-meta">
  18.         <?php abyline_posted_on(); ?>
  19.         </div><!-- .entry-meta -->
  20.         <?php endif; ?>
RAW Paste Data
Top