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

Silas Selekane
PLUS
Silas Selekane
Courses Plus Student 306 Points

One Page WordPress Site Workshop not working, even the theme on the project file. Kindly assist.

One Page WordPress Site Workshop not working, even the theme on the project files not working.

Hugo Paz
Hugo Paz
15,622 Points

We need more information if we are to help. Do you get an error? Can you tell us the steps you took to install wordpress. Was it working before?

Silas Selekane
Silas Selekane
Courses Plus Student 306 Points

Thanks Hugo for the reply, my question is related to the following code on one-page-site.php . It does not seem to work. I even tried to using the project files theme to check if i am making a mistake, it does not work too.

<?php
/**
 * Template Name: One Page Site
 */

get_header(); ?>

    <div id="primary" class="content-area">
        <main id="main" class="site-main" role="main">

            <?php 
                $args = array(
                    'post_type' => 'page',
                    'order' => 'ASC'
                );
                $the_query = new WP_Query( $args );         
            ?>
            <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?> 

            <?php get_template_part( 'content', 'page' ); ?>

            <?php endwhile; endif; ?>

        </main><!-- #main -->
    </div><!-- #primary -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>
Sean T. Unwin
Sean T. Unwin
28,690 Points

Silas Selekane, I have edited your comment to format your code to be more readable.

For reference on posting code and formatting it you may refer to this thread - https://teamtreehouse.com/forum/posting-code-to-the-forum

:-)

3 Answers

Silas Selekane
PLUS
Silas Selekane
Courses Plus Student 306 Points

Hi i finally got it .... created a new Wordpress site and works fine. Thanks for all the help.

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Hey man,

What exactly are you getting outputted? Have you added your pages in the admin area?

Silas Selekane
PLUS
Silas Selekane
Courses Plus Student 306 Points

Hi Zac, yes i have. can i create provide you with link to check it out?