Title: Old posts completely disappear
Last modified: August 19, 2016

---

# Old posts completely disappear

 *  Resolved [dumcoder](https://wordpress.org/support/users/dumcoder/)
 * (@dumcoder)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/old-posts-completely-disappear/)
 * I have a post that completely disappeared from my site. The publish date was 
   8/14/2010.
 * The code that grabs it and puts it on my front page is:
 *     ```
       <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); if( $post->ID == '23' ): ?>
       <? global $custom_metabox2; $meta = get_post_meta(get_the_ID(), $custom_metabox2->get_the_id(), TRUE); ?>
       <? if(!empty($meta['bar_alert'])){ echo '<div id="bar_alert">' .  $meta['bar_alert'] . '</div>';} ?>
       <?php endif; ?>
       ```
   
 * The solution was to edit the publish date from 8/14/2010 to 12/14/2010.
    After
   that change the post appeared on the site again.
 * My question is, what would cause this?

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/old-posts-completely-disappear/#post-1839201)
 * the loop will only grab as many posts as are set in ‘settings’ ‘readings’ ‘blog
   show at most [] posts’ – therefore, if you have any larger numbers of newer posts,
   your code will not get this one post.
 * you could look into using a custom query, such as:
 *     ```
       <?php query_posts('p=23');
       if ( have_posts() ) : while ( have_posts() ) : the_post();
       global $custom_metabox2; $meta = get_post_meta(get_the_ID(), $custom_metabox2->get_the_id(), TRUE);
       if(!empty($meta['bar_alert'])){ echo '<div id="bar_alert">' .  $meta['bar_alert'] . '</div>';}
       wp_reset_query(); ?>
       ```
   
 * the exact solution depends on the rest of the code you ommitted from your snippet.
 * [http://codex.wordpress.org/Function_Reference/query_posts#Post_.26_Page_Parameters](http://codex.wordpress.org/Function_Reference/query_posts#Post_.26_Page_Parameters)
   
   [http://codex.wordpress.org/Function_Reference/wp_reset_query](http://codex.wordpress.org/Function_Reference/wp_reset_query)
 * or check `get_post()`
    [http://codex.wordpress.org/Function_Reference/get_post](http://codex.wordpress.org/Function_Reference/get_post)

Viewing 1 replies (of 1 total)

The topic ‘Old posts completely disappear’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/old-posts-completely-disappear/#post-1839201)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
