As all of WordPress is written in the PHP programming language, template tags are a PHP function used to either generate or display information on the fly. Essentially, template tags are much like regular tags that you can add to your posts in that they are used to identify and sort information inside the template.
WordPress comes built-in with several template tags, but you can also design your own. For example, one of the built-in template tags is “get_header()” which, much as you might expect, retrieves the header information from the template.
In short, a template tag is a tiny snippet of PHP code that tells WordPress to either do something or else to retrieve something. If you look inside the “header.php” file on your WordPress site, you’ll see a string that contains “bloginfo.” This is the template tag that tells your WordPress site how to display the name of your website (the default setting is to use the H1 header tag when showing your website’s name).
Template tags also come with parameters, including:
name – The name of your website.
description – Also known as your website’s “tagline,” a brief description of what your site is all about.
url – To reveal the URL or internet address for your website.
version – The current version of WordPress that you are using. When WordPress is first installed, it comes with a theme that displays this information in the footer section.
admin_email – To reveal your website’s administrator email.
You can code new template tags yourself or install plugins that will do it automatically.
Because template tags are PHP functions, you can also use them inside other PHP functions, mixing and combining them as you like in order to get a software command to do something.
Latest posts by Jamie (see all)
- Twitch Stats For 2020 – Interesting Facts and Figures About Twitch.com - January 28, 2020
- Facebook Live Stats – 2020 - January 26, 2020
- LinkedIn Stats For 2020 - January 22, 2020