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 How to Make a Website with WordPress Custom Post Types and Fields in WordPress Custom Post Type Templates

Satnam Singh
Satnam Singh
7,194 Points

art.php is having unnecessary codes

Why you're using the loop starting from Line 11 - 36 ?

I'm not able to understand at all ! I've removed that loop and it works just fine, can you please explain why you're using that much extra code ?

Please explain.

1 Answer

Hi Satnam,

That is a general wordpress loop. This would pull the page content when you use that as a template.

The query below the while statement is setup to pull in information from the post_type of art.

Say for example I want to have art shown below the information on an about us page. Using this template it would pull my content from the admin then show pieces of art or whatever the post type of art is below said content.