Title: Missing First Post
Last modified: August 18, 2016

---

# Missing First Post

 *  Resolved [Doraemon](https://wordpress.org/support/users/doraemon/)
 * (@doraemon)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/)
 * Hi all, I’ve been working on styling my first post differently from the rest 
   of my post so that I can have kind of a headline look and feel followed by the
   rest of my posts. This is what I’ve come up with thus far:
 * `<?php 
    if (have_posts()){ while (have_posts()) : the_post(); if (!is_single()&&
   $post==$posts[0]){ include('fpost.php'); } else { include('post.php'); } endwhile;}
   else { ?>
 *  <h2 class="center">Not Found</h2>
    <p class="center"><?php _e("Sorry, but you
   are looking for something that isn't here."); ?></p>
 *  <?php } ?>
    </div> </div>
 * For some reason the first posts fails to show. Any suggestions? Thanks in advance,
 * Max

Viewing 15 replies - 1 through 15 (of 15 total)

 *  [Joshua Sigar](https://wordpress.org/support/users/alphaoide/)
 * (@alphaoide)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233236)
 * What’s the content of the following files?
 * `fpost.php
    post.php
 * Paste it here: [http://pastebin.com](http://pastebin.com)
 *  Thread Starter [Doraemon](https://wordpress.org/support/users/doraemon/)
 * (@doraemon)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233237)
 * Both files are currently the same: [http://pastebin.com/312165](http://pastebin.com/312165)
 *  [Joshua Sigar](https://wordpress.org/support/users/alphaoide/)
 * (@alphaoide)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233241)
 * So, the file contains another loop??? So, you have a loop inside a loop (a nested
   loop)?
    Explain, please… (unless you have no clue, then say so)
 *  Thread Starter [Doraemon](https://wordpress.org/support/users/doraemon/)
 * (@doraemon)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233247)
 * It’s quite simple really, I’ve put the code that holds the formatting of my posts
   into two different files. As you can see the PHP says, if this is the first post,
   use this file for the post or if this is any post but the first post, use this
   file to format the post. Make sense? There’s actually only one loop.
 *  [Joshua Sigar](https://wordpress.org/support/users/alphaoide/)
 * (@alphaoide)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233265)
 * Hmm, in index.php you have…
    `start loop include FILE end loop
 * Now, what’ s the content of FILE? Here…
    `start loop do stuff end loop
 * Go back to index.php, replacing FILE with its content.
    `start loop start loop
   do stuff end loop end loop
 *  Thread Starter [Doraemon](https://wordpress.org/support/users/doraemon/)
 * (@doraemon)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233267)
 * I’m not sure I understand what you mean…? The code is working just fine, other
   than the fact that the first post is not displaying. The code you see in the 
   files, was that code that previously in the index.php. I was only using *one*
   loop then. Now all I’ve done is extract the formatting portion of the post and
   put that into a separate file. ( One for the first post, one for the rest of 
   the posts. ) I haven’t really touched the loop at all, thus there shouldn’t be
   a second loop. 😉
 *  Thread Starter [Doraemon](https://wordpress.org/support/users/doraemon/)
 * (@doraemon)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233268)
 * So my question remains: why isn’t my code showing the first post after it’s parsed..?
 *  [Joshua Sigar](https://wordpress.org/support/users/alphaoide/)
 * (@alphaoide)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233272)
 * In that FILE: [http://pastebin.com/312165](http://pastebin.com/312165) , just
   delete the following extra loop(!)
 * The start:
    `<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post();?
   >
 * The ending:
    ` <?php endwhile; ?> <?php endif; ?>
 *  Thread Starter [Doraemon](https://wordpress.org/support/users/doraemon/)
 * (@doraemon)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233274)
 * Okay, I think I’ve confused you as I’m not the only one working on this, the 
   file was updated since I’ve talked to you and it turns out both files are not
   the same, which makes no sense to me. At any rate, if I remove those tags, this
   is what happens:
 * [http://binrecycle.com/](http://binrecycle.com/)
 * Now the first post is showing… Buuut, as you can see..
 *  Thread Starter [Doraemon](https://wordpress.org/support/users/doraemon/)
 * (@doraemon)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233275)
 * This is the content of post.php: [http://pastebin.com/312213](http://pastebin.com/312213)
 *  [Joshua Sigar](https://wordpress.org/support/users/alphaoide/)
 * (@alphaoide)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233276)
 * Okay, then, give the latest, frozen version of the files.
    Give me three separate
   links to pastebin.com for index.php, fpost.php, and post.php
 *  Thread Starter [Doraemon](https://wordpress.org/support/users/doraemon/)
 * (@doraemon)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233282)
 * Absolutely, give me five minutes.
 *  Thread Starter [Doraemon](https://wordpress.org/support/users/doraemon/)
 * (@doraemon)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233284)
 * fpost.php: [http://pastebin.com/312219](http://pastebin.com/312219)
    index.php:
   [http://pastebin.com/312218](http://pastebin.com/312218) post.php: [http://pastebin.com/312217](http://pastebin.com/312217)
 *  [Joshua Sigar](https://wordpress.org/support/users/alphaoide/)
 * (@alphaoide)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233288)
 * In post.php, delete the following line.
 * `<?php endwhile; ?>`
 *  Thread Starter [Doraemon](https://wordpress.org/support/users/doraemon/)
 * (@doraemon)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233290)
 * Thanks! Works like a charm. ^.-

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Missing First Post’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 15 replies
 * 2 participants
 * Last reply from: [Doraemon](https://wordpress.org/support/users/doraemon/)
 * Last activity: [20 years, 9 months ago](https://wordpress.org/support/topic/missing-first-post/#post-233290)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
