Display only one wordpress sticky post on your homepage
November 28, 2008
Do you use WordPress as a CMS instead of a blog? If yes, you’ll probably be interested to know how you can display a single post on your blog homepage. Open your index.php file, and replace your current loop by this one (replacing the stickies category name by the category of your choice) by: <?php if (have_posts()) : $my_query = new WP_Query('category_name=stickies&showposts=1'); while ($my_query->have_posts()) : $my_query->the_post(); ?> That’s all! Only the latest post is displayed... [Read the full story]
Disable all your wordpress plugins in a second
November 28, 2008
Sometimes, for exemple when you have to upgrade your blog, you need to disable all your plugins. Depending to how much plugins you’re using, it can takes a lot of time and be kinda boring. We got the solution to this problem, with a simple recipe to disable all your plugins on a second. First of it all, login to your phpmyadmin and choose your WordPress database. Once done, click on the sql button to open the sql command window. Then, simply paste the following sql command and execute it. UPDATE wp_options SET option_value... [Read the full story]
Create an ads rotator with php for wordpress
November 27, 2008
If you wanted to be able to display a group of X image ads in your theme. Nothing hard with this. But, you also wanted to be able to add as many ads as you’d like. Nevermind how many ads you added, only 4 must be displayed at the same time. Then how to do that? We came up with the solution of a rotator which will take X items, sort them randomly and pick up 4 of them for being displayed. To achieve this, We will create a php array which will contains another array for each item, with infos as such as title, image and... [Read the full story]
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]




















