It is difficult to say without viewing the code. On the main page (which, based on another post of yours, I assume is a home.php file) I don’t see where the non-sidebar Loop is. What are the posts displayed by that instance of the Loop?
Furthermore, what template is used to display the single posts? Index or single.php? Is the Loop there different from that used on the homepage? Or it’s the same and is “excluding” the category shown in the sidebar?
Thread Starter
hesed2
(@hesed2)
Thanks for your response, moshu. The home page is a little different. On that page there’s only one instance of The Loop (well, except for the sidebars) pulling posts from a particular category. Those posts are the ones titled “Welcome!” and “Current Series”.
The right and left sidebars are in separate files, so I don’t think that’s the issue. The single posts are using single.php. Here’s the code for that template:
<?php get_header(); ?>
<div class="outer">
<div class="float-wrap">
<div class="center">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><?php the_title(); ?></h2>
<div class="entry">
<?php the_content('Read the rest of this entry »'); ?>
</div>
<p class="postmetadata"><?php edit_post_link('edit','',''); ?>
</div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Next Entries »') ?></div>
</div>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.
<?php include (TEMPLATEPATH . "/searchform.php"); ?>
<?php endif; ?>
</div> <!-- end centered div -->
<?php include (TEMPLATEPATH . '/left_column.php'); ?>
<?php get_footer(); ?>
Thread Starter
hesed2
(@hesed2)
I figured it out. I’ll post the solution here in case anyone else has this problem.
After doing some reading on permalink structure in the codex I saw that “%category% does not work correctly with mod_rewrite in Apache versions prior to 2”. So, I took that out of my my permalinks. I then had only %postname% left, and also saw that there can be problems using only %postname%. So I added %post_id% at the end, and got another strange, but different problem. After some more fiddling, I reversed the permalink structure, leaving me with “/%post_id%/%postname%/”. This worked! So everything is fine now.
The codex should probably be updated, though, to say note only that there are problems using only %postname%, but there are also problems using %postname% first.
Thanks for taking the time to respond, moshu.