You will also see tag parameters introduced here, which are additional options you can include in the tag to control some of its display properties. Not all template tags have parameters. You place tag parameters inside the parentheses of the tag. Many of the parameters discussed here were obtained from the WordPress software documentation in the WordPress Codex.
This table helps you understand the three variations of parameters used in WordPress.
Variation | Description | Example |
Tags without parameters | These tags have no additional options. Tags without parameters have nothing within the parentheses. | the_tag(); |
Tags with PHP function–style parameters | These tags have a comma-separated list of values placed within the tag parentheses. | the_tag( '1,2,3' ); |
Tags with query-string parameters | These tags generally have several parameters. This tag style enables you to change the value for each parameter without being required to provide values for all available parameters for the tag. | the_tag( 'parameter=true '); |
- String: A line of text that can be anything from a single letter to a long list of words. A string is placed between single quotation marks and sets an option for the parameter or is displayed as text.
- Integer: A positive or negative number. Integers are placed within the parentheses and either inside or outside single quotation marks. Either way, WordPress processes them correctly.
- Boolean: A parameter that sets the options to
true
orfalse
. This parameter can be numeric (0=false
and1=true
) or textual. Boolean parameters aren’t placed within quotation marks.
The WordPress Codex has every conceivable template tag and possible parameter known to the WordPress software.