Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a custom post type to get images. I am setting up my theme to display a specific way when it is first installed. For some reason, my code is stopping the bottom half of my page from displaying.

 <div id="gallery">
    <?php if( $loop->has_posts()): ?>
    <hr />
    <h1 class="tag-background"><span class="background">FROM THE GALLERY</span></h1>
    <ul>
    <?php
        while ( $loop->have_posts() ) : $loop->the_post(); ?>
           <li><?php if ( has_post_thumbnail()) : ?>
                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute();?>"><?php the_post_thumbnail('frontpage_gallery'); ?></a> </li>
                 <?php endif; ?>
            <?php endwhile; ?>
    </ul>
        <?php endif; wp_reset_query();?>
</div><!--END gallery-->

When I view source, the only part of the gallery div that shows above is the opening div. Everything after that including the footer is gone. This happened when I put all the gallery stuff between the if statement. What am I missing?

 if( $loop->has_posts()):

 endif;
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

I think your issue is $loop->has_posts(). Try $loop->have_posts().

share|improve this answer
    
I am such a dork. I should have seen that. Thanks. That fixed my issue –  Jamie Dec 4 '12 at 4:33
    
We've all been there. Sometimes all it takes is a second set of eyes! –  Matthew Boynes Dec 4 '12 at 4:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.