I need to add the date and author to blog posts. The line needs to read like this example:
Posted on January 20, 2018 by Name
Clicking on the date will take you to a page with all posts published on that date. Clicking on the Name/author will take you to a page with all posts by that author.
I did some research and was able to find code to add to the single.php template.
<div class="sample">Posted on <?php the_date(); ?> by <?php
the_author(); ?></div>
I will need to create a class for "sample". How do I get the date and author to link where they need to go?
Here is the code for my single.php file:
<?php
/**
* The Template for displaying all single posts.
*
* @package WordPress
* @subpackage Cornerstone
* @since Cornerstone 1.0
*/
get_header(); ?>
<div class="row">
<div class="small-12 medium-12 columns">
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="date">Posted on <?php the_date(); ?> by <?php
the_author(); ?></div>
<div class="breadcrumbs" xmlns:v="http://rdf.data-
vocabulary.org/#">
<?php if(function_exists('bcn_display')){bcn_display();}?>
</div>
</div>
</div>
<div class="row">
<div id="primary" class="site-content small-12 medium-8 columns">
<div id="content" role="main">
<?php do_action( 'cornerstone_before_content' ); ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php do_action( 'cornerstone_after_content' ); ?>
</div>
</div>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>