Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have built a site that uses the "posts" type to display their galleries as normal posts. It is set to be sorted by custa meta date and continue on down the page.

As of right now, I have made 15 posts, but for some reason my page is only showing 11. Maybe you can help me out, as I have kind of been thrust into a "wordpress" developer role, and am learning as i go along.

site in question: http://lurehollywood.com/gallery

here is the loop:

<?php $gallery = new WP_Query(
                array(
                'post_type' => 'post',
                'posts_per_page' => -1,
                'order' => 'DESC',
                'orderby' => 'meta_value',
                'meta_key' => 'datetime'
                )
        ); ?>
        <?php while ($gallery->have_posts()) : $gallery -> the_post(); ?>
share|improve this question
do all 15 posts have the datetime meta key? inspect the query to see if the query vars are being set as you expect, add print_r($gallery); after the query. – Milo Feb 2 at 0:25
funny you should ask, as I had the same thought when I noticed that stripping out the query vars led to all the posts showing. I went into php_myadmin and noticed that the missing posts were using a date key while the others were on datetime. A quick edit of my initial meta box function and an edit of the loop and everything seems to be working perfectly! – Michael Thomas Richards Feb 2 at 0:33

closed as too localized by toscho Mar 4 at 22:21

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.