• So this is very frustrating.. I have two query_posts running on this page. The first one puts the content into a css/jquery slider, and the second one dumps each page’s title & content into a div (called “bucket”) to be retrieved for page display. i’m using query_posts on both because i need gallery shortcoded to work.

    the thing is, certain of my posts are randomly not coming up in the 2nd loop- they work fine in the get_pages loop that creates the secondary nav bar (within the slider) AND HERE’S THE KICKER- it works fine one minute then the next any particular post might randomly not show up. other ones still show up and the same post info still comes throught the get_pages loop.

    I’ve even looked in the mysql database and the ones that dont show up seem to be identical (except for id & content etc)- why are they not showing up? if i delete the post then recreate it, it works fine.

    i have a feeling this might be related to the “Types” custom post type plugin, but that’s just a hunch.

    here’s the second loop:

    <br />
    						<?php endwhile;<br />
    						rewind_posts();</p>
    <p>						query_posts('post_type=page');<br />
    						while (have_posts()) : the_post();<br />
    						?><br />
    						<div class="content_bucket" id="<?php echo $post->ID;?>"><br />
    						<h1><?php echo $post->post_title; ?></h1><br />
    						<p><?php the_content(); ?></p><br />
    						</div><br />
    						<?php<br />
    						endwhile;<br />
    						?><br />

    you can see the site at https://ricbecker.com/jennyhilljazz – the Bands / Discography is the one *currently* not working

Viewing 5 replies - 1 through 5 (of 5 total)
  • Try replacing rewind_posts(); with wp_reset_query();.

    Thread Starter ricbecker

    (@ricbecker)

    Nice suggestion, but no dice. I was working in that direction but the weird thing is that only one or sometimes a whole sub-tree (like, children of “About” page or something) doesn’t show.

    i also tried using $blah = new WP_Query(etc) but it comes out the same.

    if everything in the “wp_posts” field in the database is the same, where else could something be getting changed that will affect the query?

    I don’t see how this can be related to Types, but to eliminate this possibility, you can temporarily disable the plugin and declare these types in PHP.

    Otherwise, I would strongly advice to enable PHP error logging and see if anything shows there.

    Thread Starter ricbecker

    (@ricbecker)

    I still haven’t figured out what was causing the problem, though I narrowed it down to something related to parentage that was happening in the 2nd query_posts call (by much removal, trial, and error).

    i moved forward by only querying pages once & using conditional statements to use the results as needed, but the question is still out there as an unsolved mystery *cue creepy music*

    the solution also works fine on the page template after wp_reset_query()

    Thread Starter ricbecker

    (@ricbecker)

    WELL HERE GOES

    I feel. so. dumb. The problem was cause by…. are you ready…. drumroll please…

    I neglected to set the posts_per_page, so query_posts was capping off at 15 or something like that. Period. end of story. I want those hours of my life back.

    let this be a lesson to the rest of you out there.. and me especially….

    (p.s. i haven’t been working on this for two weeks, I had to go to venice for a bit then I just couldn’t muster the courage to get back on it last night. i fought for a couple hours, almost cried, then revelation hit me on the train to the bronx)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Posts randomly don't show up!’ is closed to new replies.