Forums
Home / Fixing WordPress / Posts Not Displaying on index.php
(@gshart)
14 years, 2 months ago
Going through to tutorial and building new theme. Posts are not displaying in index.php. Thank you in advance for your help.
Here’s the code:
<div id=”container”>
<?php if(have_posts()):?><?php while(have_posts()):the_post();?> <?php endwhile;?> <?php endif;?>
</div>
(@rvoodoo)
Might wanna read the tutorial there a bit more…..You haven’t actually told wordpress to display anything there….
You’ve got the setup for the loop
you need to tell it to display the_content or the _title or the_author or the_excerpt….etc
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <!-- do stuff ... --> <?php endwhile; ?> <?php endif; ?>
you need the stuff!!! http://codex.wordpress.org/The_Loop http://codex.wordpress.org/The_Loop_in_Action#The_Default_Loop
Thanks!
The tutorial I am using is supposed to be very good, but apparently missing some things…