WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Help Getting Date and Author Information to Display on Post Excerpts

[Resolved] Help Getting Date and Author Information to Display on Post Excerpts

  • Hello,

    This might be a really basic question, but I can’t seem to figure out how to add date and author information to my blog excerpts using the Twenty Twelve theme. I had modified the child content.php code to get the excerpts to display, but I am not sure what code to add to have the date of the post and author information display again.

    My content.php code

    Here is my website.

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • how about adding this:

    <footer class="entry-meta">
    			<?php twentytwelve_entry_meta(); ?>
    			<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
    			<?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>
    				<div class="author-info">
    					<div class="author-avatar">
    						<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 68 ) ); ?>
    					</div><!-- .author-avatar -->
    					<div class="author-description">
    						<h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
    						<p><?php the_author_meta( 'description' ); ?></p>
    						<div class="author-link">
    							<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
    								<?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentytwelve' ), get_the_author() ); ?>
    							</a>
    						</div><!-- .author-link	-->
    					</div><!-- .author-description -->
    				</div><!-- .author-info -->
    			<?php endif; ?>
    		</footer><!-- .entry-meta -->

    Wow, thanks that code was very helpful. So now the author and date information is displaying but it is also displaying a bunch of other stuff that I would like to remove, but have not been able to figure out how to do this.

    For instance on the first posted article, I would like to remove all of the following from showing (text, tags, categories): “This entry was posted in Travel Advice, United States and tagged Calistoga, Napa, Napa besides wine, Napa Valley, Napa Valley without wine, Napa without wine, non-drinker, Oxbow Market, travel, wine country, Yountville”

    Instead I just want it to display
    Posted on July 28, 2013 by travelcats

    Updated content.php code

    How about this?
    <p>Posted on <?php the_date(); ?> by <?php the_author(); ?></p>

    For reference:
    http://codex.wordpress.org/Function_Reference/the_date
    http://codex.wordpress.org/Function_Reference/the_author

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Help Getting Date and Author Information to Display on Post Excerpts’ is closed to new replies.
Skip to toolbar