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

Nils Sens
Nils Sens
9,654 Points

One page layout with WordPress

Hi everyone!

I'm working through the WP tracks because I'm building a WordPress site for a friend and I hit a wall trying to learn how to do it the 'WordPress way'.

I realized that the example site in the one-page video is pretty much what I'd love to build. So that was really encouraging. But the track stops short of what I need to know:

As in that example, I would also really want everything to appear on one vertical scroll, including the MENU that links to SECTION IDs, instead of URLs.

However, I would want the individual SECTIONs to be accessible through the WP dashboard. Since it's all on one PAGE, am I right assuming that I'd need to enable my friend to add POSTs (of different POST TYPEs)?

Or would I be able, to somehow build it in a way that the vertical SECTIONS are referenced as PAGEs, to edit them individually?

Thank you so much!

Nils

3 Answers

I think that using a custom post type is probably the way to go. You can include them all on the home page, give their main section wrapper an id, and then give each menu link a custom url to jump to the relevant section (ex. href="#section-one")

Nils Sens
Nils Sens
9,654 Points

Thank you Erik!

That would mean that I only need to instruct my friend to add / change all content via custom-post-type in his dashboard? That would be reasonable.

Is it possible to create e.g. an entire image gallery as a custom post type? I hope that's not too much trouble.

Another thing I was thinking about was if there's any way to hack the WP API in a way that sections become pages, and their alignment along one vertical scroll will be done after everything is loaded... not sure how to go about this one, though. :)

Regards, Nils

You can do pretty much anything you like with WP, it just takes experience and practice to figure out how, and then some more xp and practice to figure out how to do it right (i.e. semanticly )

There are a bunch of good WordPress tutorials here that would really help set a foundation for you to go ahead and build this theme you are talking about.

Nils Sens
Nils Sens
9,654 Points

Thank you for the encouragement, Erik!

I'll try to get my head around the custom-post-type thing. Thanks for pointing me there :)

Will try to come up with something more concrete before bothering you guys again :D

Thank you again!