As stated in the title, my 404 template in WordPress does not show up every time a non-existent URL is accessed in my site. The page works perfectly in FireFox and Chrome, though. So I made a quick search and found that the solution is to add another header information in the page. So here’s what to insert at the very start of 404.php.
<?php ob_start(); ?>
<?php header("HTTP/1.1 404 Not Found"); ?>
For this, credit goes to wpcanada.
http://wpcanada.ca/2008/03/20/ie-and-custom-error-pages/
Read more…
This is another super simple and yet super helpful WordPress function that took me a while to find. I’m currently working on a WP Theme that requires me to show the category name. And I thought it isn’t right to write an SQL including all the necessary stuffs that comes with querying the database just to get the category name. There must be a simpler and better way… and there is! Here’s the simple code to do just that.
<?php get_cat_name( $cat_id ); ?>
Cool!
Reference: http://codex.wordpress.org/Function_Reference/get_cat_name
The problem looks like below.
You do not have sufficient permissions to access this page
The supposed permission problem has occured before and mainly involves plugins. For older version of wordpress, your problem may be solved by one or both of the
- Change of table prefix - I suggest you visit this to solve that problem. And it also solves a string of other things, too.
- Failed Upgrade - If you used an automatic upgrade and failed, it is possible that the version number saved in the database is already updated. You can force upgrade it by updating the your version number. Another alternative is by using MarkAquit’s script here
However, these solutions are only applicable for older versions of WordPress. If you have a clean install, you should not encounter this. That’s why it didn’t work and was back to square one of investigation. Upon further checking, it turned out that the problem is related to old plugins. Apparently, there are plugins that was written before the current releases and whose parts of the code is no longer compliant with the current version of WordPress.
Finding the offending plugin is a bit tricky especially if you are using a lot of plugins. Luckily, I only encounter this in a contact page plugin and replace it accordingly with a new plugin which was released lately. The problem with my older plugin is that there’s no more active development. And so when some of the codes were deprecated, the plugin fails.
So what’s the problem then? Old Plugins.
I’ve been encountering this for a number of times already and on each time, I had to upgrade WordPress manually(through SSH to make it faster). Now, I was able to partially solve this by removing/renaming the existing upgrade folder under wp-contents. You can follow the steps below.
- Login to your server via FTP
- navigate to wp-contents folder
- rename the existing upgrade folder to a new name(you can also choose to delete)
- under wp-contents folder, create a new folder named upgrade
- set permission of the new upgrade folder to 666
- re-run the upgrade from within wordpress
Read more…
I have been customizing wordpress themes ever since I started using it. I also made several themes from scratch for my websites. Though making a theme from scratch is fulfilling, customizing a freely available template simply makes the process faster. As they say, why do you have to reinvent the wheel? But the problem with free templates for use as baseline is that they usually look the same. And most are simply garbage. So what’s the alternative? Shell out some money for a premium theme.
And shell out, I did! But it took time for me to find very affordable set of themes that suits my needs and taste. As most of you know, premium themes cost an arm and a leg. We’ve seen wordpress templates that costs above $80 apiece and you can only use that in one domain. That’s the main reason why I shy away from it until I found Elegant Themes. At a price of $19.95 per year, you’ll be able to download all their current themes plus future releases. I got 17 A+ themes when I signed up and more to come in the coming months. That made the price of each theme a little of $1. That’s a fraction of the cost my time if I do the coding myself. And their themes are all XHTML/CSS compliant and compatible with major browsers including Opera, Safari and Netscape.
What’s good with Elegant Themes is that they don’t require you to. However, the themes are not released through GPL. That means you cannot redistribute the themes with your changes. This makes the license of the template incompatible with WordPress template which is released through GPL. But I don’t really care for now.
Read more…