Support » Fixing WordPress » Categories are displaying incorrectly on hompage

  • Hi all,

    My website (magazine style) has started to do something strange –

    On my home page each post (excerpt) should have it’s category listed underneath it along with how many comments. The exact same code is used on archive.php and it works perfectly.

    However, on my homepage – this is not working. Whatever category my latest post is in (e.g. – currently ‘Seagull Serious’) the code converts all the other posts to the same category. Similarly, If I click on the comments link of any post on my homepage it is linked to the first post. Again, this doesn’t happen inside archives.php pages.

    I should probably stress, although they appear to be in the wrong category all the posts are still in the correct category. It is only a visual thing – where they appear to be in the wrong category.

    The following is the code for my hompage –

    The code in bold is for displaying the categories/comments and this is the same on archive.php (which works!)

    <h2>” href=”<?php the_permalink() ?>” rel=”bookmark”><?php the_title(); ?></h2>
    <p>by <?php the_author()?></p>
    <p><?php echo strip_tags(get_the_excerpt(), ‘‘); ?></p>
    <p><span class=”continue”>
    ” href=”<?php the_permalink() ?>”>Read the full story</span></p>

    <h3 class=”posted”>Posted in <?php the_category(‘, ‘) ?><span class=”comments”><?php comments_popup_link(‘Comments (0)’, ‘Comments (1)’, ‘Comments (%)’); ?></span></h3>

    I got rid of all my widgets in my sidebar and nothing changed – so not them.

    I am really confused as I have no idea what has caused this?!

    A million thankyous to anyone that can help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • please replace includes/featured.php with fresh one. if you dont have fresh one please do let me know.


    [signature moderated Please read the Forum Rules]

    Hi Kevin,

    Thanks for getting back to me. I replaced includes/featured.php with the original version. But they were exactly the same size, so I assume nothing had been altered?

    just to confirm – this is where I found the file


    I have just realised the “read more” is also only linking to the latest post as well!?

    Any other ideas?



Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Categories are displaying incorrectly on hompage’ is closed to new replies.