Bramernic
Forum Replies Created
-
I’d like to know this too. It’s a great plugin and it works, but it would be comforting not to be warned that it’s untested with the current version.
Plugin No 404 Errors now available.
Forum: Fixing WordPress
In reply to: 404 not working properlyI’ve written a plugin to get round this problem. It traps 404 errors and changes them to 301 while redirecting to a page specified in settings. It’s called No 404 Errors.
Forum: Fixing WordPress
In reply to: Style pages differently on search resultsSearch results is a specific file within your theme directory. You can edit that file so it just displays titles.
Update:
Thanks all for your help, especially Hfort. It turns out that 404 handling is the one feature of WordPress which is not compatible with the shared hosting platform that I use. Marvelous!
The workaround that I am now developing involves using a cut-down version of the smart404 plugin to redirect all 404s to a specific page number (set in options) using 301 instead. It’s not ideal, but it does avoid displaying a page full of HTML. To stop the page being included in wp_list_pages I’ve made it private, but that also required a change to the page template file for the title (to stop the pre-pending of “Private: “).
I’ll consider making this plugin available once I’m happy it is as straightforward as it can be.
Thanks for those thoughts. The smart-404 plugin looks interesting, although it seems to work in conjunction with 404.php so might still exhibit the problem. I’m going to contact my hosting tech support to see whether they are doing anything that conflicts with WP. It does seem strange that everything else works though.
Final note to anyone thinking of using my workaround above. On one of the two sites that I put it in last night it now skips fewer characters this morning so the fix had to be adjusted. I’m not sure what the extra variable is that caused this change, but it certainly points towards the hosting being at fault. I guess it might be a timing issue, which will be almost impossible to resolve.
I’m using an amended White Boxes by Dr Oguz. I have already tried other themes including the default one and they all fail in the same way. Here is the .htaccess file:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPressThe hosting I am using is Fasthosts.
Forum: Fixing WordPress
In reply to: Better to edit php files in FTP or WordPress?Ah, you’re using a WP installation through your hosting. I apologise but I’ve not used that route before. It is possible that using FTP to edit a file from CPanel may be the same as using the WP editor. When you save using the FTP client does it copy it back automatically? If yes then there is no difference in the end result.
Forum: Fixing WordPress
In reply to: Better to edit php files in FTP or WordPress?Just to clarify, are you talking about versions on your own computer and your hosting? If you are then using the WP editor will amend the one on your hosting. If you need a copy on your computer you’ll need to ftp it back again.
I can see I need to post the file that works so you can see how ridiculous it is. Apologies in advance for the length of the code box.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title> <link rel="shortcut icon" href="/favicon.ico" /> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php wp_head(); ?> </head> <body> <div id="wrapper"> <div id="header"> <a href="<?php echo get_option('home'); ?>"><img src="/images/blog_logo.jpg"></a> </div> <!-- header --> <div id="wbody"> <div id="content"> <div class="post"> <h2 class="posttitle">Error 404 - Not Found</h2> <div class="entry"> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p>Sorry! but the page you requested </p> <?php get_header();?> <div id="wbody"> <div id="content"> <div class="post"><div class="topcorn"> <h2 class="posttitle">Error 404 - Not Found</h2> <div class="entry"> <p> </p> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> <p> </p> <p> </p> <p> </p> </div> </div></div> </div> <!-- content --> <?php get_sidebar();?> <?php get_footer();?>As that site should no longer exhibit the problem, here is the url of another site that does: http://www.carolinepilling.com/. This one is a completely different theme written by another developer.
@hfort: The closing div is actually the first line in footer.php. I didn’t write the original theme, although I’ve made significant changes since. It was just a very simple theme called white boxes to get me started.
@esmi: Yes it is part of the sidebar template because that is where it gets up to before starting to output. When I added lots of extra stuff in 404.php I saw more of the sidebar code, then eventually the extra stuff in 404.php. This is how I know it isn’t a problem with any of my template files. Remember, I also copied 404.php over the top of page.php and when I tried to display a page it showed me a properly formatted 404 page.
@hfort: Here is the code from the original 404.php file:
<?php get_header();?> <div id="wbody"> <div id="content"> <div class="post"> <h2 class="posttitle">Error 404 - Not Found</h2> <div class="entry"> <p>Sorry! but the page you requested has either been deleted or does not exist.</p> </div> </div> </div> <!-- content --> <?php get_sidebar();?> <?php get_footer();?>The site I’ve been playing with I’d prefer not to put the URL in the public domain just yet. However, the other site is http://www.desirephotography.co.uk/blog. Just add any garbage to the end. I will probably be adding my ‘fix’ soon to that site as it is one of my clients.
Yes, sort of.
I only have 1 plugin activated [not counting Hello Dolly ;)], but I have more than one site with the same problem and another site doesn’t have that plugin. It’s Improved include page by the way.
I did also switch to the default theme and the same issue occured. I meant to mention that above, sorry.
Forum: Fixing WordPress
In reply to: wp_list_pages listing nightmareIf you display the pages to a depth that includes the lowest level you might want (eg depth=1 will show pages and sub pages) then you can use CSS to hide the children you don’t want to see. Basically, if you look at the page source you will see that every list item has a series of classes that tell you whether it is the current page, the parent of the current page or a child of the current page. Using these classes you can show or hide lines using “display none” or “display block”.
Hope this helps.