Overwrite WordPress core functions

November 26, 2008

This is a really, really, bad idea to modify WordPress core files. Why? Simply because you’ll have to modify that file again when you’ll upgrade your blog. Here’s how to overwrite WordPress core function without modifying any core file. Why overwriting instead of replacing? At first, modifying a core file seems a lot easier than overwriting it. But what will you do when you’ll have to upgrade your blog? New WordPress versions are released something like every two months, so it might be a long and... [Read the full story]

Disable commenting on wordpress posts older than 30 days

November 25, 2008

Sometimes, it can be useful to automatically disable commenting on posts older than X days. There’s no built-in function in WordPress to do that, but if you still like to do it, just read this article. To enable auto comment closing, simply paste the following function on the functions.php file from your theme. If that file doesn’t exists, create it. You can easily change the number of days after posts can’t be commented by changing 30 to X on line 3 of the close_comments() function. <?php function close_comments(... [Read the full story]

List WordPress category feeds

November 25, 2008

Let’s see how we can list all category feeds by using the good old wp_list_categories() fiunction. Simply paste the following code anywhere on your theme. It will output a list of your categories with a link to the category rss feed. The two parameters used here are: feed_image: The url of the image to display as a link to your feed. feed: The feed format. <?php wp_list_categories('feed_image=www.livexp.net/rss.gif&feed=XML Feed&optioncount=1&children=0'); ?>  Read More →

Customize the Auto Discovery of Your WordPress Feed

November 24, 2008

As a blogger, one great way to grow your blog is to promote your RSS feed.   What many people might not realize is a lot of bloggers use modern web browsers auto discovery feature when subscribing to a blog. Are you taking advantage of this feature? By default, your WordPress theme will come with auto discovery built into the header.php file.  The code should look something like this: <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url');... [Read the full story]

Prevent WordPress Plugins From Breaking Your Theme

November 24, 2008

Have you ever deactivated a WordPress plugin only to find that your WordPress blog no longer works?   This is something that can happen in any situation where a WordPress plugin is called by your WordPress theme without using the proper statement.   How Can I Avoid This Problem? Whenever you add plugin functionality to your WordPress theme that uses a call, make sure to turn it into a variable, so your theme won’t break if the plugin is deactivated.  An example would be the popular Related posts plugin that most... [Read the full story]