Support » Fixing WordPress » All Post Links Going to Latest in that Category

  • katenelson


    I am having a problem with all of the links for posts displaying the wrong entry. It seems that no matter what link I click on, the latest post in that category is what is displayed (although the link and page title are correct).

    I have tried adjusting permalinks/default links and clearing .htaccess
    I have tried deactivating all my plugins, but get same errors.

    I did recently follow the WP instructions for moving the install from a sub-directory to the root directory, but was having isolated issues with this even before the move.

    The site is at:

    Thanks for any help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • katenelson


    Just to update this one… I did upgrade to 2.6, but still having the same issue!

    Im going to update this in case anyone else is having the same issue and is looking for some help…

    This thread helped too:

    My issue was with a query I was running in the sidebar that figured out what category the current post belonged to, and then displayed content based on that. I think I just need to update it to be current with this version of WP, so if anyone has suggestions on how to do this better, let me know. Here was the offending code:

    <?php if ( is_single() ) :
            //setup post data
            global $post;
            //get the category(s) of current post
            $categories = get_the_category();
            //loop through each category the post belongs too
            foreach ($categories as $category) :
            <div class="sidebar_content">
            	<div class="sidebar_content_top">
                    <h1>More <?php echo $category->name; ?> Posts</h1>
                    //how many other posts from each of the current posts category
                    $posts = get_posts('numberposts=5&category='. $category->term_id);
                    //loop through posts
                    foreach($posts as $post) :
                    //print post links ?>
                    <a href="<?php the_permalink(); ?>" class="sidebar_link"><?php the_title(); ?>
                    <?php endforeach; ?>
                </div><!--- end sidebar_content top div --->
                <div class="sidebar_content_bottom">&nbsp;
            </div><!--- end sidebar_content div --->
            //end categories loop
            endforeach; endif ; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘All Post Links Going to Latest in that Category’ is closed to new replies.