Difference between revisions of "WordPress Template Tag"
From Wiki @ Karl Jones dot com
Karl Jones (Talk | contribs) |
Karl Jones (Talk | contribs) |
||
(One intermediate revision by the same user not shown) | |||
Line 19: | Line 19: | ||
Conditional template tags test for specific conditions. | Conditional template tags test for specific conditions. | ||
− | Example, the [[WordPress is_archive | + | Example, the [[WordPress is_archive function|is_archive]] function: |
<pre> | <pre> | ||
Line 32: | Line 32: | ||
* [[WordPress function]] | * [[WordPress function]] | ||
− | * [[WordPress is_archive | + | * [[WordPress is_archive function]] |
* [[WordPress Loop]] | * [[WordPress Loop]] | ||
* [[WordPress Template]] | * [[WordPress Template]] |
Latest revision as of 18:00, 25 October 2016
In WordPress, Template Tags are a type of WordPress function, used in WordPress Templates to display information, test conditions, etc.
Example: bloginfo()
The code below displays the name of the blog:
<?php bloginfo('name'); ?>
It is often used in the header.php
file, along with HTML, like this:
<h1><?php bloginfo('name'); ?></h1>
Conditional tags
Conditional template tags test for specific conditions.
Example, the is_archive function:
<?php if ( is_archive() ) { // write your code here ... } ?>