Viewing 4 replies - 1 through 4 (of 4 total)
  • Put the code below the post title to show author name and date below the post title , in your themes single.php .

    Author : <?php the_author_posts_link(); ?> , Date : <?php the_time('j F, Y ') ?>

    edit content.php in a child theme,
    and move this whole section:

    <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
    						/** This filter is documented in author.php */
    						$author_bio_avatar_size = apply_filters( 'twentytwelve_author_bio_avatar_size', 68 );
    						echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
    						?>
    					</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 -->

    up to below this line:

    <?php endif; // is_single() ?>

    to change the wording of the post meta data, copy the code of the function twentytwelve_entry_meta() from functions.php of Twenty Twelve into functions.php of the child theme and edit it there.

    example of edited function code:

    function twentytwelve_entry_meta() { //edited
    	// Translators: used between list items, there is a space after the comma.
    	$date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
    		esc_url( get_permalink() ),
    		esc_attr( get_the_time() ),
    		esc_attr( get_the_date( 'c' ) ),
    		esc_html( get_the_date() )
    	);
    
    	$author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
    		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    		esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
    		get_the_author()
    	);
    
    		$utility_text = __( '<span class="by-author"> by %2$s</span> on %1$s', 'twentytwelve' );
    
    	printf(
    		$utility_text,
    		$date,
    		$author
    	);
    }

    Thread Starter venkymyfreelancelifestyle

    (@venkymyfreelancelifestyle)

    sir

    i edited functions.php and content.php file as you said.but below the post title,i am unable to see auther name and date.and there is no stuff like “this entry was posted…” below the post,fine, i don’t want that stuff.

    the problem is to remove”leave a reaply” and add author name and date below the post title.

    https://myfreelancelifestyle.com

    I am using a Highwind-child theme and also would like to add author name and date below the post title …without the “this entry was posted” info. Is there any code I can add to the editor css?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘how to add author name and date below the post title twentytwelve-child’ is closed to new replies.