[resolved] Duplicate Titles, Correct Entries (5 posts)

  1. bigrodey77
    Posted 8 years ago #


    Right now I'm working on a website that would like a blog. I have installed WordPress and it is "working." I have created my own site and I'm just using parts of The Loop to get the bits and pieces that I need.

    My problem is that when I open my blog, it shows me my four posts (they are test posts and that's all I have added so far), yet it is showing incorrect title names.

    I have two pictures here, one of the list of posts from the admin section of WordPress and one of how they look on my site. I'm sure the images will do more justice that my description can.

    If I have left any information out or you need more information let me know and I'll post it ASAP.

    Thanks in advance,



    P.S. Sorry I had to post links to the images, I couldn't see away to put images directly in the post...

  2. bigrodey77
    Posted 8 years ago #


    I forget to add that if I use the index.php page that came with WordPress and *not* my code, everything works fine.

    I know everyone will say check my code and I already have. Here is the main part of my code where I am using the WordPress functionality.

    <div id="content">
    			<?php if (have_posts()) : while (have_posts()) : ?>
    			<span id="title"><?php the_title(); ?></span><br />
    			<span id="time"><?php the_time('F jS, Y'); ?></span><br /><br />
    			<?php the_post(); the_content(); ?><br />
    			<span id="category">Posted in <?php the_category(', ') ?></span><br /><br />
    		    <?php endwhile; endif; ?>
  3. bigrodey77
    Posted 8 years ago #

    Something ... Anything ... Anyone?

  4. Kwebble
    Posted 8 years ago #

    Put the call to the_post() at the beginning of the while loop. It sets up the data for the next post that functions like the_title() use.

    In your code the title is displayed before the post data is updated.

  5. bigrodey77
    Posted 8 years ago #


    If I could buy you a beer I would.


Topic Closed

This topic has been closed to new replies.

About this Topic