WordPress.org

Ready to get started?Download WordPress

Forums

WordPress 3.3.1 Category/Tags 404 Problem (7 posts)

  1. nike2000
    Member
    Posted 2 years ago #

    Hallo,

    I have a big problem with WP 3.3.1 Yesterday I search about 8 hours to solve the problem.

    My WordPress 3.3.1 gives a 404 on a Category or Tag. But with Problem happens only with enabled Permalinks.

    I'm using Apache 2 as Webserver.

    I've tested the following methods fix the problem (without success):
    - disabled all plugins
    - changed themes
    - rewrite .htaccess

    I cannot understand how to fix this issue, to reproduce the Problem just try to open a category like this:

    http://www.erfolg-reich.org/c/detektiv/

    OR a tag like this:
    http://www.erfolg-reich.org/s/hund/

    The Tag Problem is a little bit different. Sometimes WordPress redirects me to a post, and sometimes to the 404 Page.

    As I found out, wordpress does not reconize correctly the requested permalink. I'm not the only one who has this Problem with 3.3.1 - but theres no solution at this time :-(

    Any help would be very useful, thx

  2. tamarajane.
    Member
    Posted 2 years ago #

    Yes, a big problem for me too. But it goes further.
    All of my Posts were assigned to Categories and were listed on Pages by the same names of those Categories. Now they've all been re-assigned to 'Uncategorized'.
    Any attempt to re-assign Posts to their correct Categories fail (in Quick Edit or Full Editing Screen).

    I'm at a loss for what to do but I may have to roll back to 3.3

    Have you had any breakthrough's? Anyone else?

  3. snipkin
    Member
    Posted 2 years ago #

    I had this problem until a few minutes ago - clicking on any category just gave me a '404' page not found. Looking through this forum I just happened to come across an answer to a similar problem - but dated a couple of years back.

    The suggestion was that you edit a page (not a post) - any page - just change it slightly and save ('update') the new version of the page. I thought I might as well try it and, to be honest, I did not hold out much hope it would change anything - but suddenly my categories all worked again - no 404s!!

    So, I cannot guarantee it will work for anyone else and I do not know why it worked for me - but it's simple to do and worth trying.

    I am using the very latest version of WordPress. I thought it was me trying out loads of different themes that had somehow messed up my categories - but it's possible the recent upgrade caused the problem?

  4. Tejstar
    Member
    Posted 2 years ago #

    snipkin - You genius. I've been having the same problem and was pulling my hair out. Changed my htaccess, themes, plugins and none of it worked until your solution. Many thanks!

  5. tamarajane.
    Member
    Posted 2 years ago #

    Humbug :(
    That didn't work for me, but thanks snip kin. I've tried rolling back one version. Then another, and another. No dice. I disabled all plugins, I commented out all of the custom post types in my functions file. Can't. Work. It. Out.

    All of my posts have defaulted to 'Uncategorized'. When I try to reallocate them, the changes are not saved. Not in the Quick Edit. Not in the Full Edit.

    Any ideas?

  6. tamarajane.
    Member
    Posted 2 years ago #

    Ok, so my issue turned out to be a corrupt table in my wp database: wp_term_relationships. A simple repair, took less than a second and did the trick.

    mysqlcheck repair

    Hope this helps someone.

  7. dsimonse
    Member
    Posted 2 years ago #

    Hi,

    I have the 404 issue in WP3.4 when paginating categories (and I had it a while since WP3.1). I browsed through the web and tried several solutions but none worked.
    @rafaelxy: What do you mean with:
    "Basicly, you CANT have a PAGE and a CUSTOM POST TYPE with the same name. If you do, the permalink rewrite rules will get confused and trigger a 404.

    A very simple solution I'm using is: The page that lists the custom post types is called in plural (eg. products) and the actual post type name is in singular (eg. product). So they dont conflict and it's all fine."

    I am quite new to WP so what is the difference btw PAGE and CUSTOM POST TYPE? I.e whe should I check if I have your described problem?

    And .. I tried your code for the function.php with no result.

    Do I have to change anything in "category.php" as well?
    The code:

    <?php get_header(); ?>	
    
    <?php
    wp_reset_query();
    $cat = get_cat_id(single_cat_title("",false));
    if ($cat == 5 or $cat == 6 or $cat == 7){
    $cat = '5,6,7';}
    $pages = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("showposts=3&paged=$pages&cat=".$cat);
    
    if(have_posts()) : while(have_posts()) : the_post(); ?>
    
    		<div class="post grid_20" id="<?php the_ID(); ?>">
    
            <?php include 'incl/info-bar.php' ?>
    
            <div class="left"><?php the_post_thumbnail( 'blog-post-thumbnail' ); ?></div>
    
    		<div class="grid_7">
    			<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    
                <?php
    			$args = array(
    				'post_type' => 'attachment',
    				'numberposts' => null,
    				'post_status' => null,
    				'post_parent' => $post->ID,
    				'showposts'   => 3,
    				'offset'      => 1,
    			);
    			$attachments = get_posts($args);
    
    			$len = 250; //Number of words to display in excerpt
    			$newExcerpt = substr($post->post_content, 0, $len);
    			if (count($newExcerpt) > 30 or count($attachments) < 3){
    			if(strlen($newExcerpt) < strlen($post->post_content)) {
    			$newExcerpt = $newExcerpt.'... <a href="'.get_permalink().'">Läs mer</a>';
    			}
    			echo '<div class="entry"><p>'.$newExcerpt.'</p></div>'; //finally display excerpt
    			} else {
    			if ($attachments) {
    			echo '<div class="images left">';
    			foreach ($attachments as $attachment) {
    			echo wp_get_attachment_link($attachment->ID, 'thumbnail');
    			}
    			echo '</div>';
    			}}
    			?>
    
    		</div>
    
            <div class="comments grid_6 omega">
    
    		<?php
    		   $args = array(
    				'status' => 'approve',
    				'number' => '2',
    				'post_id' => $post->ID, // use post_id, not post_ID
    			);
    			$comments = get_comments($args); if($comments) { ?>
    
            <h4><?php comments_popup_link('', '1 Kommentar', '% Kommentarer'); ?></h4>
            <ul>
            <?php
    		   foreach($comments as $comment):
    
               $length = 40; // adjust to needed length
               $thiscomment = $comment->comment_content;
               if ( strlen($thiscomment) > $length ) {
               $thiscomment = substr($thiscomment,0,$length);
               $thiscomment = $thiscomment .' ...';
               }
               ?> 
    
    			<li id="comment-<?php comment_ID() ?>">
    
    			<div class="left"><?php echo get_avatar( get_comment_author_email(), '40' ); ?></div>
    			<p><a href="<?php the_permalink(); ?>/#comment-<?php comment_ID() ?>"><?php comment_author(); ?></a>:
    			<?php echo ($thiscomment);?>
                <br />
                <span><?php echo human_time_diff(get_comment_time('U'), current_time('timestamp')) . ' sedan'; ?></span></p>
    
    			</li>
    
    			<?php endforeach; ?>
    		</ul>
            <?php } else { ?>
            <h4><a href="<?php the_permalink(); ?>">Inga kommentarer (Kommentera)</a></h4>
            <?php } ?>
    
    		</div>
    
    		</div> <!-- .post -->
    
    		<?php endwhile; endif;?>
    
            <div class="undernav grid_17 push_3">
    
    <?php if (function_exists("pagination")) {
        pagination($additional_loop->max_num_pages);
    } ?>
            </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    The URL: http://rojteatern.nu

Topic Closed

This topic has been closed to new replies.

About this Topic