Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.