• I’m very new to WordPress so this is probably a very very simple problem.

    I want index.php to display my latest post.

    This is what I have so far:

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : query_posts('p=1'); ?>
    
    <span id="a1"><?php the_time('F jS, Y') ?></span><br />
    <h3><?php the_title(); ?></h3>
    <br />
    <?php the_content(); ?><br />
    <?php the_tags('Tags: ', ', ', '<br /><br />'); ?>
    <a href="<?php bloginfo('rss2_url'); ?>" class="rss">Subscribe!</a><br /><br /> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
    
    <?php endwhile; ?>
    
    <br /><span class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></span>
    <span class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></span>
    
    <?php else : ?>
    
    <h2>Error</h2>
    <br />Can't find anything like that.
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    <?php endif; ?>

    This only works in displaying the title, date and tags of the post. It won’t display the content.

    Any help appreciated.

    Thanks

Viewing 1 replies (of 1 total)
  • hi. you need to add:
    <?php the_content(); ?>

    Probably you’d want this after your <h3>

    Best,
    seej

Viewing 1 replies (of 1 total)
  • The topic ‘Display latest post’ is closed to new replies.