Difference between revisions of "WordPress Template Tag"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(Example: bloginfo())
Line 9: Line 9:
 
<pre>
 
<pre>
 
<?php bloginfo('name'); ?>
 
<?php bloginfo('name'); ?>
 +
</pre>
 +
 +
It is often used in the <code>header.php</code>, along with HTML, like this:
 +
 +
<pre>
 +
<h1><?php bloginfo('name'); ?></h1>
 
</pre>
 
</pre>
  

Revision as of 21:06, 11 October 2016

In WordPress, Template Tags are units of PHP code used within WordPress Templates to display various types of information.

Not to be confused with HTML tags, which also appear in Templates.

Example: bloginfo()

The code below displays the name of the blog:

<?php bloginfo('name'); ?>

It is often used in the header.php, along with HTML, like this:

<h1><?php bloginfo('name'); ?></h1>

See also

External links