WordPress.org

Ready to get started?Download WordPress

Forums

All Post Links Going to Latest in that Category (3 posts)

  1. katenelson
    Member
    Posted 5 years ago #

    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: http://easia.imb.org

    Thanks for any help!

  2. katenelson
    Member
    Posted 5 years ago #

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

  3. katenelson
    Member
    Posted 5 years ago #

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

    This thread helped too: http://wordpress.org/support/topic/147500?replies=7

    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>
    
                    <ul>
                    <?php
                    //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 ?>
                    <li>
                    <a href="<?php the_permalink(); ?>" class="sidebar_link"><?php the_title(); ?>
                    </a>
                    </li>
    
                    <?php endforeach; ?>
                    </ul>
                </div><!--- end sidebar_content top div --->
                <div class="sidebar_content_bottom">&nbsp;
                </div>
            </div><!--- end sidebar_content div --->
            <?php
            //end categories loop
            endforeach; endif ; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic