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

David Jarrin
PLUS
David Jarrin
Courses Plus Student 11,182 Points

One page wordpress theme linking.

Ok so I started making a site following the wordpress bootstrap tutorial and got some good stuff from it. I also decided that I wanted to make this particular site a one page site, so I began watching the one page wordpress tutorial but I cant get passed a key part of the tutorial.

The part I am getting hung up on is switching my page.php page name to one-page-site.php. When I do this and add the code

/*
Template Name: One-Page-Theme
*/

to the top of the now one-page-site.php file I am able to see the template "One-Page-Template" in page attributes when editing the home page but when I change my home page to that template and add this code to one-page-site.php

<?php 
                $args = array(
                    'post_type' => 'page',
                    'order' => 'ASC'
                );
                $the_query = new WP_Query( $args );         
            ?>

the pages are still separate. It should also be mentioned that in the tutorial it is suggested that you type "Test!!!" somewhere in one-page-site.php and "Test!!!" should show up on your home page but it doesn't show up when I load the page, it does show up when I type it in a file I have named front-page.php. Any suggestions would be appreciated as usual.

1 Answer

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

If you have a front-page.php it will override other files for controlling the homepage.