WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Very Strange Permalink Behavior (2 posts)

  1. misterpatrick67
    Member
    Posted 2 years ago #

    Hello all,

    very strange problem just started happening on a site I'm developing. Everything was working fine and suddenly all pages and posts route to the same post (single.php) page. I mean everything, archive, page etc except for the homepage. I have no idea what might have triggered this as there are several of us populating the site with content to get ready for launch.

    I'm using a custom permalinks structure but even going back to default results in the same thing. The URL is reading correctly but it will only show this one post. Deleting the post results in everything going to a 404 page.

    Is something in the database broken? Only using a couple of plugins and nothing that deals with the permalinks.

    Any ideas, I've never seen this before.

  2. misterpatrick67
    Member
    Posted 2 years ago #

    Ok, figured it out. I had forgotten that I had a small loop pulling navigational items in the header and for some reason that was screwing the other loops up. Stupid me.

    Here is the code. Any idea what is wrong with this loop? No idea why it is totally screwing up all the permalinks when it's included.

    <?php $temp_query = $wp_query; ?>
    	<?php query_posts('cat=22'); ?>
    	 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
      			   <li><a href="<?php the_permalink() ?>"><?php the_title() ?></a> </li>
    
    		<?php endwhile; ?>
    
    	<?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.