March 7th, 2008
by
Brett Bumeter
Here’s a really scary scenario. You wake up one morning and check your WordPress blog and something doesn’t look right. You login and can’t quite place it but something is missing.
You go to write an article, and after finishing the write up you try and select a category and that’s when you notice it. The categories are gone! They’ve disappeared like a Chinese accountant performing an audit. Where did they go?
Well, this is a known and unanswered WordPress error.
Now, when I saw this error myself on my blog, I first checked my WordPress version. I was working on 2.3.2 and 2.3.3 was available. My first move was to upgrade to 2.3.3, with a manual ftp upload (I didn’t want to trust Fantastico when I was troubleshooting.) That didn’t work unfortunately.
Then I came across this article about the database for WordPress being out of date, in addition to or as an alternative to the actual files.
Remember WordPress is a program -> Files that manage the content stored in your MySQL database, which also needs to be upgraded from time to time.
Just add /wp-admin/upgrade.php to the end of your domain to check and see if your database can be upgraded.
That same article however mentioned that the WordPress files in 2.3.2 were in (translated into layman terms) a ‘little screwy’.
I found a suggested fix that made sense. However, when I tried to get into MySQL and update the field below, I was unable to make any changes on the fields (MySQL error 17 ).
I run a dedicated server, and after wracking my brain, took the drastic step of restarting MySQL on my server. After I did that, my categories on my blog were back!
The fix below still made sense. MySQL may have stalled due to memory issues, so I still wanted to try and upgrade at least one site just to test it to see if it might help.
So I tried this fix
The Fix is a two part process. You have to fool your WordPress program into thinking that the Database is out of date, so that it can then run the upgrade program and update the database.
Sometimes apparently the database upgrade will run, not complete itself, but change the value in your database telling you that your database is up to date. It then will not upgrade when you hit the button, so you have to reset the field value in the DB so that it will run again.
The field can be found under the table name -> yourdbname_options and then go to field db_version. Mine was set at 6124 (latest for 2.3.2) and so I reset it to 5183.
To write over the field in the database (something I had never done before)
The upgrade did run this time, but for me I received a couple errors when tables could not be upgraded. I got the sense that in that previous article describing the fix, that person may truly have had the issue of a db upgrade that stalled out, but in my case that was not the problem.
Therefore, I’d recommend that if anyone runs into this problem, call your ISP to restart your mysql server first. Then if you still have a problem, you might consider changing values in MySQL, which is rarely something anyone recommends. Short of that try and avoid over stressing, drinking yourself silly and getting funneled through drug treatment centers. This problem may be easier to fix than it appears if you just ask for a little help.
Note. If your host is a real pain to work with, my apologies for the hold time you may have to endure.
February 18th, 2008
by
Brett Bumeter
Here’s a little plugin that I should have looked for a long time ago!
It adds RSS feeds to all of your categories. This is very handy if your blog is somewhat diverse and some of your readers want to specifically follow just a category or 2 via a feed.
Its even more useful if you want to establish some interesting layouts on your blog with pages, feeds, and feedburner!
The Plugin
The plugin can be found at Perishable Press. Its called Category Live Bookmarks which is kind of an old fashioned way to refer to feeds and getting a link to a feed, but there is not too much that is old fashioned about the plugin in its final execution. Its compatible with WordPress 2.3.
It doesn’t come with an installation folder, which is a little annoying if you like to keep your folders and plugins organized. Fortunately it only has 3 files.
You Upload and activate the plugin, then replace your normal category list call with the code provided by perishable.
<?php if (function_exists(‘clb_plus’)) { clb_plus(); } ?>
You can then set some variables to display the feed icon or a count of articles next to each category or what have you and that’s about it. There are CSS options if you want to code things more effeciently with CSS.
Rocking and Rolling with Feeds
Once you have this setup, you can achieve some very interesting results with your blog design and organization of articles, pages, and more creating a very dynamic presentation.
One of these days, I’ll write a more complete document on how to do this, but for now I’ll just leave you with the plugin. Later on when you are ready for the step by step tutorial but do not want to walk up the stairs yourself, I’ll power up a stair lift tutorial and let you go to town, like that old lady in the Movie Gremlins that gets ejected out of her house.
January 29th, 2008
by
Brett Bumeter
It has been maybe a year since I last wrote the script for hiding pages in WordPress. Now, I’m rebooting one of the blog themes on an old site and I need to break out some skills that have grown a little stale. Its kind of like when you go through a corporate relocation and have to go back through the process of configuring your voice mail and can’t quite remember what you used to know how to do.
So I need to hide some of the pages (not posts) that appear in the menu section of my new blog theme.
For example maybe you have an About page and a Policy page and you do not want the Policy page to show up as a menu button in your theme, so you exclude it from the call so that only the About button shows up in the menu. Then you put a simple little link to the policy page in the footer of your website as is customary for many sites.
I did a quick search and came up with an article by the Realivent, real estate marketing blog of all places.
Its kind of cool to have some many Davinci types in the world these days that have so many talents!
Anyway the article I found actually offered up some script that essentially seems to install a plugin or something in WordPress so that you can hide pages at a global level. That was definitely interesting, but over kill for what I was looking for.
But in that article the writer, Matt, mentioned covering several examples in the past. This time he updated it with ways to both exclude specific pages and to include specific pages.
I was in the market for excluding and jumped over to his older article and found this:
The last way is to hardcode your menu function. Wordpress created the menu with this function: wp_list_pages();
You can either remove that function and add your own links, or add the “exclude” argument to wp_list_pages() like so:
wp_list_pages(exclude=17,38);
How to hide Pages in wordpress
Now that code if I am not mistaken has an error in it. The exclude section should have quotes around it and should look like this (I think Matt corrected this in his second article, but I couldn’t follow his train of thought to see if he actually did or didn’t fix it. He mentions fixing it, but I do not see the big red arrow pointing to an example of the fix.
(’exclude=17,38′)
My Addition to this coding Saga
I had to make a few special additions to the code and I’d thought I offer up my own examples in case anyone else runs into having to combine the exclude or include commands for pages into a line of code that already has other commands running in it.
Before I started I had this in my list_pages line
<?php wp_list_pages(’sort_column=menu_order&depth=1&title_li=’); ?>
After I added the exclude command (with an ‘&’ sign) it looked like this
<?php wp_list_pages(‘exclude=467&sort_column=menu_order&depth=1&title_li=’); ?>
Plus, I added my menu to the bottom of my site, but this time I included ALL pages.
<?php wp_list_pages(‘include=467,465,466,611,2&sort_column=menu_order&depth=1&title_li=’); ?>