December 2017
Beginner
458 pages
7h 52m
English
Now we need to make the fields in the preceding code dynamic. We'll start with the meta class since that's at the top. Let's replace 2:00pm with <?php the_time ();?> and 03-29-2017 with <?php the_date(); ?>, as shown here:
Posted at <?php the_time(); ?> on <?php the_date(); ?> by Brad
Now to replace the author name (Brad, in our case), we will grab the following code from the content.php file and add it in place of Brad:
<a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php the_author(); ?></a>
So this makes the metadata dynamic.
Read now
Unlock full access