Template Tags are used in your Template Files to display information dynamically or otherwise customize your site.
How to Use Template Tags:
To use a template tag, simply place it within your template file where you want the content to appear.
<article>
<h2><?php the_title(); ?></h2>
<p>Posted by <?php the_author(); ?> on <?php the_date(); ?></p>
<div><?php the_content(); ?></div>
</article>
Conditional Tags returns boolean value that can be used in your Template Files to alter the content depending on the conditions that the current page matches.
How to Use Conditional Tags:
1. Checking if it’s the Homepage
<?php if ( is_home() ) : ?>
<p>This is the homepage.</p>
<?php endif; ?>
2. Checking if it’s a Single Post
<?php if ( is_single() ) : ?>
<p>This is a single post.</p>
<?php endif; ?>
Please explore the template tags and conditional tags to achieve the following in the coding exercise:
Go through the following handbook pages to know all conditional and template tags functions.