Appendix B. Template Tags

IN THIS APPENDIX

  • Understanding the template tag concept

  • Breaking down the WordPress templating system

Templating systems have existed for a long time and have become a major part of most content management systems. The concept behind templating systems is that raw code is abstracted for the sake of ease of design and clean code for designers.

Understanding the Template Tag Concept

One of these templating systems include the Smarty template system (www.smarty.net/), which uses curly braces to designate a template tag (for example, {include file='header.php'}). Additionally, many would consider PHP itself a templating system of sorts.

Each of the blog platforms that compete with WordPress also include template systems that assist in maintaining clean and easily understood themes. For example, Blogger uses tags similar to <$BlogOwnerProfileURL$&> and Movable Type uses tags like <$mt:AuthorDisplayName$&>.

Breaking Down the WordPress Templating System

WordPress has its own set of template tags. This appendix has been created as a reference to all of the template tags available to theme developers along with all Arguments that can be used.

Note

For more on template tags, see Chapter 12.

Many of the template tags listed here can take either an array of Arguments or a query string. An array of Arguments might look like this:

template_function (array ('arg1' =&> 'val1', 'arg2' =&> 'val2'))  ;

The same set of Arguments in a query string would look like this:

template_function ('arg1=val1&arg2=val2') ...

Get WordPress® Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.