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've found other questions asking the same thing but I think I followed the method correctly.

I created a page called "Splash" (page-splash.php) and another empty page called "Blog"

But when I change the settings in "Reading" the main page is working (WP loads page-splash.php correctly) but the the loop in my index.php is NOT returning any posts.

! http://i.imgur.com/ZLVlp.png

This is my index.php

<?php get_header(); ?>

<div id="content">

<?php query_posts($query_string . '&cat=-3'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<div class="post">

<!-- Display the Title as a link to the Post's permalink. -->
<h2><?php the_title(); ?></h2>

<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
 <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>

  <p><?php the_content(); ?></p>

 </div> 

 <?php endwhile; else: ?>
 <p>Sorry, no posts matched your criteria.</p>
 <?php endif; ?>

</div>
<?php get_footer(); ?>

The thing that confuses me if I remove the whole use a static front page feature and just return to the normal settings. The loop in index.php is working...

Update: here's the site I'm working on. http://www.christiegrahamphotography.com/2012/wordpress/ Click into blog will return zero posts (I have 3 published posts)

share|improve this question
    
What are the values returned for get_option( 'page_on_front' ) and get_option( 'page_for_posts' )? –  Chip Bennett May 7 '12 at 17:16
    
I think this may have something to do with the query. I copied this query <?php $recentPosts = new WP_Query(); $recentPosts->query('showposts=5&cat=-3'); while($recentPosts->have_posts()): $recentPosts->the_post(); ?> from another answer in stack and it worked. –  Ken Ma May 7 '12 at 17:22

1 Answer 1

up vote 1 down vote accepted

When you use "static front page" are you selecting the actual page you want displayed on the home page?

It sounds like you want the "Splash" page as the home page. You should create the Splash page in the Page Edit Screen, select a custom page template if that is what you're wanting to use and save the page. Now you'll go to Reading>Front Page Displays *Static Page and choose the Splash page from the drop-down list. Your front page should then display the Splash Page.

Then you would select the blank page Blog in the drop-down list next to the Latest Posts option.

share|improve this answer
    
The splash page is working fine when I select it as the "front page" in reading. The loop isn't working anymore. When I set the "posts page" in reading to Blog, it should read off the original index.php right? it seems to be doing that but it's returning zero posts. have_posts() is returning false as far as I can tell. –  Ken Ma May 7 '12 at 16:57

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.