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

How to Build a WordPress Theme

Is there anywhere I can download the completed project files? I have followed through the course and tried replicating it to the exact code but the background colours on the homepage slider do not appear. I would like to compare my code to the finalised code but can't seem to track it down.

Thanks in advance.

3 Answers

Matthew Mascioni
Matthew Mascioni
20,444 Points

I found the completed project files on the last stage of the project; under Final Check-in With Client. From expanding the .zip file it looks like there's a complete theme and installation in there, though I could be wrong. Hope it works!

In addition, keep in mind you can always post on the forums with your code to try and get advice to help you rectify the bug.

If you have the working code, can you upload your full code listing for front-page.php? That is where I think I my issue is. Following on from your advice, I'll upload my code in a second.

<?php get_header(); ?>
    </div>
    <div id="featured" class="clearfix flexslider">
        <ul class="slides">
        <?php 
            $args = array(
                'post_type' => 'work'
            );
            $slideshow_query = new WP_Query( $args );          
        ?>          
        <?php if ( have_posts() ) : while ( $slideshow_query->have_posts() ) : $slideshow_query->the_post(); ?>
            <li style="background-color: <?php the_field('background_color'); ?>">
                <div class="container">
                    <div class="grid_8"><img src="<?php the_field('homepage_slider_image'); ?>"></div>
                    <div id="featured-info" class="grid_4 omega">
                        <h5>Featured Project</h5>
                        <h3 style="color: <?php the_field('button_color'); ?>"><?php the_title(); ?></h3>
                        <p><?php the_field('description'); ?></p>
                        <p><a class="btn blue" style="background-color: <?php the_field('button_color'); ?>" href="<?php the_permalink(); ?>">View Project &rarr;</a></p>
                    </div>
                </div>              
            </li>

        <?php endwhile; endif; ?>
        </ul>
    </div>
    <div class="container clearfix">
        <div class="grid_12 omega">
            <h5>Featured Post</h5>
        </div>
        <?php

            $args = array(
                'post_type' => 'post',
                'category_name' => 'featured',
                'posts_per_page' => 1
            );

            $the_query = new WP_Query( $args );

        ?>

        <?php if( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
        <div class="push_2 grid_10 omega clearfix">
            <article>
                <?php get_template_part( 'content', 'post' ); ?> 
            </article>
        </div>

        <?php endwhile; endif; ?>

        <div class="grid_12 omega clearfix">
            <div class="grid_6 recent-post">
                <article>
                    <h5>Recent Post</h5>
                    <?php

                        $args = array(
                            'post_type' => 'post',
                            'cat' => -1,
                            'posts_per_page' => 1
                        );

                        $the_query = new WP_Query( $args );

                    ?>

                    <?php if( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

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

                    <?php endwhile; endif; ?>

                </article>
            </div>
            <?php

                $args = array(
                    'post_type' => 'work',
                    'posts_per_page' => 1
                );

                $the_query = new WP_Query( $args );

            ?>

            <?php if( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

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

            <?php endwhile; endif; ?>
        </div>

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

<?php get_footer(); ?>