Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Sorry, my previous post did not include details:
    In my situation, I exported the posts as xml, edited content in all the posts and used wordpress import tool to re-import them.
    I changed the code so that it will re-write existing posts and not skip them.

    If your case if you are just re-importing, with the exact contents, category, comments, etc, you don’t have to make changes to the code. Just import using WP tool, it will skip the existing ones (posts with the exact same title are considered existing) and import only the new ones.

    Hi,

    I had a solution for this in WP 2.8.4 time. Don’t if that same would work for you. I had to edit the wp-admin/import/import.php file.

    I removed the if

    if ( $post_exists ) {
    			echo '<li>';
    			printf(__('Post <em>%s</em> already exists.'), stripslashes($post_title));
    			$comment_post_ID = $post_id = $post_exists;
    		} else {

    And then inserted the below code at the printf(__(‘Importing post….
    Also rememember to remove the closing tag for the first if statement (II one after wp_set_post_tags($post_id, $post_tags);

    // changed code here for if stmt
    if ( $post_exists ) {
    $ID = $post_ID;
    					$postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input', 'page_template');
    
    					$comment_post_ID = $post_id = wp_update_post($postdata);
    					printf(__(' and updated'));
    				} else {
    					$comment_post_ID = $post_id = wp_insert_post($postdata);
    					printf(__(' and created new Post/Page'));
    				}
    
    			}

    Let me know if you need more help.

    it WORKS for me now… I had changed rewrite.php and removed ‘category’ from category base. Apparently permalinks didn’t like this. Once I put it in, and used a clean new .htaccess file uploaded via ftp, it works ok now.

    Thanks for all your help

    joelsandberg.. you need to activate mod_rewrite in httpd.conf…

    regarding my problem – i did changes to kses.php, rewrite.php and then .htaccess.. I have reset all of them, but still same problem. Pages work, category page shows the post, home page shows the posts, but single post in atahualpa won’t show. I tried the classic theme, deactivate all the plugins, won’t work. If I put default option for permalinks /?p=123, it works. Pretty permalinks wont work at all. Funny thing is it works for pages all the time. I have multiple WP in one machine, where ever I tried to make those changes last week, they are all broke, it was working for the past 1 year. Any help would be appreciated.

    Thanks

    404 – Not found, Sorry, but you are looking for something that isn’t here.

    I have the same problem on my WP install since last week. It was running ok for last 1 year with permalink /yyyy/mm/dd/postname format without a hitch. Last week I tried to meddle with three things – kses.php, rewrite.php, and .htaccess. I have tried to reset all the changes, have changed all the file permissions, ownerships of those files.

    It does this:
    Pages are working ok, posts are showing up in homepage (if it shows latest posts), category pages are showing latest posts. It gives the 404 error in date-wise pages and single post pages. It works if reset to default permalink structure. It was working for about a year now, and there are other WP installations on the same apache which has permalinks working.

    Any help would be appreciated.

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)