Loop in pages not working
-
Hi,
I have a very simple loop, that placed in my index.php works perfectly. But, as soon as I set WP to a static front page, and then choose a page template (home.php in my case), the loop doesn’t work. I just can’t work it out, surely it’s exactly the same thing?!
I’m hosting locally, so can’t post any URLs, but I can post my loop code:
<?php while (have_posts()) : the_post(); ?> <div id="newswrap"> <a href="<?php the_permalink() ?>" title="<?php the_title(); ?> - Arabella"><h2 class="floatleft"><?php the_title(); ?></h2></a> <a href="#" title=""><h3 class="floatright">more news...</h3></a> <a href="#" title=""><h4 class="clear"><?php the_time('jS F Y') ?></h4></a> <div class="blog-post-content"><!-- Start Post --> <?php the_content(); ?> </div> <!-- End Post --> <div id="sharepost"> <a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-via="arabellamusicuk">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> <div id="facebook-share-button"><script src="http://connect.facebook.net/en_US/all.js#appId=208640855839088&xfbml=1"></script><fb:like href="http://facebook.com/arabellamusicuk" send="false" layout="button_count" show_faces="false" font=""></fb:like></div> </div> </div> <!-- End Newswrap --> <?php endwhile; ?>
And without the markup:
<?php while (have_posts()) : the_post(); ?> <?php the_permalink() ?> <?php the_title(); ?> <?php the_title(); ?> <?php the_time('jS F Y') ?> <?php the_content(); ?> <?php endwhile; ?>
Also, just to note, I’ve set a ‘posts’ page in the Settings > Reading section as just a blank page…
Thanks in advance!
James
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Loop in pages not working’ is closed to new replies.