WordPress Words: Template Tags

Template Tags: A template tag is PHP code that dynamically creates and displays design choices on a WordPress Site. Template tags are found within Templates and Plugins.
WPBeginner

Example Usage: We’ve updated the post title template tag in the single post template file to be in an h1 heading not h2.

About the Word

WordPress Themes set the design for a WordPress site. Themes include template files for different aspects of a WordPress Theme, i.e., the text colors and fonts for a heading. Inside of each template file are WordPress code blocks represented by template tags, PHP code that specify the parameters of those design decisions.

Template tags are essentially PHP functions used redundantly in WordPress to generate content and code. The WordPress Loop is made up of PHP instructions combined with template tags to generate the content on every web page in WordPress. Template tags are used to generate the post or Page title, article title, author byline, meta data, dates, categories, tags, widgets, all the key elements of a WordPress site.

Not all template tags are found in every Theme. That means that even if something is defined by a template tag, unless the Theme designers have chosen to use that tag within their design.

For example, this template tag adds a black heart before and after the title:

<?php the_title('&hearts; ', ' &hearts;'); ?>

It would look like this:

♥ Title of Your Article ♥

Template tags are the basic building blocks of a WordPress site.

For More Information

Advertisements

One thought on “WordPress Words: Template Tags”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s