Browsing Posts tagged Wordpress

Here’s an update of how to show empty categories using the default Category widget in WordPress 2.7.  My previous post was for pre-2.7 WordPress sites, this update is still simple; actually it’s easier since WordPress switched to using an array for the category arguments. continue reading…

This is a hack, but a simple one.  Surprisingly enough, WordPress 2.3 doesn’t have an option in the default category widget to show empty categories.  Personally I prefer to only show categories that have posts, but here’s a really simple way to do it.

If you are not using widgets, use this to call the list category function with the proper parameters in sidebar.php or whatever file you’re using to display the categories:

$args = “hide_empty=0″;
wp_list_cats($args);

If you are using widgets, it’s just as easy,  open /includes/widgets.php and search for “$cat_args” (should be around line 627 or so).  Change this line:

$cat_args = “orderby=name&show_count={$c}&hierarchical={$h}”;

to

$cat_args = “hide_empty=0&orderby=name&show_count={$c}&hierarchical={$h}”;

I’m sure there is a simple way to change the properties of the default category widget to  allow you to set that parameter through the widget UI, but this works great and doesn’t cause any problem using widgets.

I was working on another blog tonight and for some reason the theme I was using had a problem with widgets.  Soon as I changed a setting in options, I’d get a PHP error which was pretty annoying.  I couldn’t get into the admin at all and figured out a simple way to update the theme manually to at least be able to get into the admin.

The theme being used is stored in the wp_options table in the database.   Simply run these MySQL scripts and your site will be set to using the default theme (it’s based on the theme folder name):

update wp_options set option_value = ‘default’ where option_name = ‘template’
update wp_options set option_value = ‘default’ where option_name =’stylesheet’

Hopefully that’ll save you some time ripping your hair out if you stumble on a theme that trashes your admin.

Here’s step by step instructions for how to automatically display your WordPress posts on your Facebook profile page. It’s very simple to setup, but for some reason Facebook doesn’t include this on your profile edit screen. My next WordPress tip will be about adding chicklets to your posts so your site visitors can share your posts to their friends through Facebook, Technorati and a bunch of other social network sites. Enjoy! continue reading…

I recently updated my template for my blog (thank you Joern Kretzschmar) and started using WordPress’ bookmarklet feature to post quick news from sites I like to visit. I didn’t want these bookmarklet posts to show up on my homepage and here is a really simple way to accomplish it. If you’re not technical, don’t worry, it’s really simple. continue reading…