Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Theme Development The WordPress Loop Common WordPress Functions Used with the Loop

Jeffrey Cunningham
Jeffrey Cunningham
5,592 Points

Codex function reference vs template tag page.

What is the difference between the function in the template tag page and the function reference. I don't understand when I would go to one rather than the other.

1 Answer

Manuel Schulze
Manuel Schulze
12,739 Points

Template tags are a specific subset of the codex functions. So in general you want to take a look at the functions reference first if you're unsure.

Template tags are functions that are used to display data dynamically. As a developer, you can use and create them for your themes and plugins. You get information out of the database and, for example, use the value of that tag to display something. Template tags are used to work with the information directly.

If you study the function reference for a while you'll find a lot of functions that doesn't fit that criteria like wp_create_user.

If you ask yourself if you need to get data out of the database or sometimes even change that information then you should take a look at template tags. For any other function look into the standard codex functions reference. I think it's not that strict and clear. So most of the time I find myself using Google to help me ;)