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 trialKonrad Pilch
2,435 PointsAssign different pages in wordpress
HI,
So as we know page.php is a name in wordpress that makes every single page look the same. Now, that page is already done. Now i have a different section that looks different and its under events. it lists all the events and when i click read more, how do i make that to go to the page that should be the same for the events but to a different page?
1 Answer
Alyne Francis
7,686 PointsIn order to do this you will need to created a new page template. 1) create a new php file called page-events.php 2) at the very top of that page add this special comment
/*
Template Name: Events Page
*/
?>```
3) Go to Pages and create a new page called "events"
4) Look for the section on the right called "page attributes"
5) Assign that page the template you created i.e Events Page
6) Now add the markup you want in the way you want on that specific page.
7) If for some weird reason in the future this page fails - double check the page attributes and try re-saving permalinks.
Best of luck! happy coding :)