All Courses > Up and Running > Chapters > The Magic of the_() and get_the_() Post Template Tags

The Magic of the_() and get_the_() Post Template Tags

Key Takeaways:

Template tags is the generic term for functions designed to work mainly inside WordPress's PHP templates, especially inside The Loop.
A common pattern, true across most template tags, is that functions beginning with get_the_ will return a value for later use, while functions beginning with the_ will echo a value directly onto the page.
Most the_() and get_the_() functions are designed to operate inside The Loop. However, many get_the_() functions can be called outside The Loop, if given a post ID as a function parameter.

Some WordPress functions are designed to work inside page templates—the PHP files like header.php, index.php, and page.php that make up the body of any WordPress theme.
Some WordPress functions are designed to work inside page templates. These functions are called template tags.
These functions are called template tags, and they're among WordPress's most impo...