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

Brittany Cerra
Brittany Cerra
7,424 Points

wp_title() vs the_title()

I'm having trouble tracking down the difference. In which cases would I use one or the other?

2 Answers

Hi Brittany,

So I am no expert on WordPress, but I have been playing around with it for a little bit now. From my understanding the wp_title() function is for use outside "The Loop" to display the title of a Page. the_title() on the other hand is used within "The Loop" and is for displaying Title of a post.

Of course, you are quite welcome.