Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In your child function.php file:
- function abyline_posted_on() {
- $link= esc_url( get_permalink() );
- $title= esc_attr( get_the_title() );
- $time= esc_attr( get_the_time() );
- $dateGMT= esc_attr( get_the_date( 'c' ) );
- $date= esc_html( get_the_date() );
- $authorURL= esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) );
- $author= esc_html( get_the_author() );
- echo ('<span class="sep">Posted on</span> <a href="'.$link.'" title="'.$title.'" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>'.$date.'</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>');
- }
- *You can name the function anything you want as long it matches the call in the content.php file. I call my function 'abyline_posted_on'
- -----------------------
- In your child content.php
- Look for this section:
- <header class="entry-header">
- <?php the_post_thumbnail(); ?>
- <?php if ( is_single() ) : ?>
- <h1 class="entry-title"><?php the_title(); ?></h1>
- ******* <?php abyline_posted_on(); ?><!-- this is the first call to the byline function for single posts -->
- <?php else : ?>
- <h1 class="entry-title">
- <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
- </h1>
- ****** <?php abyline_posted_on(); ?><!-- this is the 2nd call to the byline function -->
- <?php endif; // is_single() ?>
- *Note* I wrap my byline calls in a DIV to style the text but that is up to you
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement