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

Jake Ford
Jake Ford
9,230 Points

If I am creating a one page custom wordpress theme, can't I just do the whole thing in index.php?

I figured I could do the whole thing in index.php, or maybe front-page.php

Another question I had was, how would I make each section editable by WYSIWYG?

2 Answers

David Perkins
David Perkins
9,607 Points

Theoretically yes you could build everything in the index.php but you'd be much better off making a custom page template and designing it all there. That way, if the user adds any further pages using your theme, they could also have access to a simple, blank page template too.

With regards to the WYSIWYG editors... you'll be best using a plugin like ACF to accomplish this task. The documentation is vast and it's really easy to implement.

Link: https://www.advancedcustomfields.com/

I would add to this that you can go and make the one page modular. Create a folder called modules, then write each php section module-"something". In your homepage template, or front-page.php use a while loop to call the the sections into the page, by using get_template_part();. this makes the code easer to maintain and creates a modular approach to programming.

And yes ACF all the way!

Jake Ford
Jake Ford
9,230 Points

THANKS GUYZ :D