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 trialSilas Selekane
Courses Plus Student 306 PointsOne 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.
Silas Selekane
Courses Plus Student 306 PointsThanks 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
28,690 PointsSilas 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
Courses Plus Student 306 PointsHi i finally got it .... created a new Wordpress site and works fine. Thanks for all the help.
Zac Gordon
Treehouse Guest TeacherHey man,
What exactly are you getting outputted? Have you added your pages in the admin area?
Silas Selekane
Courses Plus Student 306 PointsHi Zac, yes i have. can i create provide you with link to check it out?
Hugo Paz
15,622 PointsHugo Paz
15,622 PointsWe 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?