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 trialStephanie Caulley
13,153 PointsMy sidebar shows up at the bottom of the page. How do I have it show at the top of the column?
So my code looks like this from my archive.php file:
<?php get_header(); ?>
<section class="two-column row no-max pad"> <div class="small-12 columns"> <div class="row"> <!-- Primary Column --> <div class="small-12 medium-7 medium-offset-1 medium-push-4 columns"> <div class="primary"> <div class="leader"> <h1><?php wp_title(''); ?> Blog Posts</h1> </div>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article class="post">
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<h2><?php echo strip_tags( get_the_excerpt() ); ?></h2>
<ul class="post-meta no-bullet">
<li class="author">
<span class="wpt-avatar small">
<?php echo get_avatar( get_the_author_meta( 'ID' ), 24 ); ?>
</span>
by <?php the_author_posts_link(); ?>
</li>
<li class="cat">in <?php the_category( ' ' ); ?></li>
<li class="date">on <?php the_time('F j, Y'); ?></li>
</ul>
<?php if( get_the_post_thumbnail() ) : ?>
<div class="img-container">
<?php the_post_thumbnail('large'); ?>
</div>
<?php endif; ?>
</article>
<?php endwhile; else : ?>
<p><?php _e( 'Sorry, no pages matched your criteria.' ); ?></p>
<?php endif; ?>
</div>
</div>
</div>
<?php get_sidebar(); ?>
</div>
</section>
<?php get_footer(); ?>
I have the <?php get_sidebar(); ?> placed where it is in the video and the final code file, yet my "Sidebar" starts below the blog posts. Please, what have I done wrong?
-- Stephanie
Nicolas Brier
20,443 PointsNicolas Brier
20,443 PointsHi Stephanie,
You probably have an issue with your classes for the primary column. Your sidebar should be probably be wrapped also with a div.
'''medium-7 medium-offset-1 medium-push-4 '''
I guess it's [foundation] http://foundation.zurb.com/sites/docs/v/5.5.3/components/grid.html so you have a 7 + 1 col (offset), so your sidebar div should have the class medium-4.
Hope it helps.
Thx