WordPress.org

Ready to get started?Download WordPress

Forums

Categories are displaying incorrectly on hompage (3 posts)

  1. maxy
    Member
    Posted 4 years ago #

    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!

    http://www.joecrogan.com

  2. Kevin S
    Member
    Posted 4 years ago #

    please replace includes/featured.php with fresh one. if you dont have fresh one please do let me know.

    Thanks

    ---
    [signature moderated Please read the Forum Rules]

  3. maxy
    Member
    Posted 4 years ago #

    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

    /public_html/wp-content/themes/gazette-dev/gazette/includes/featured.php

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

    Any other ideas?

    Thanks,

    Graeme

Topic Closed

This topic has been closed to new replies.

About this Topic