nav-left cat-right
cat-right
How To Disable Post Revisions in WordPress

How To Disable Post Revisions in WordPress...

Since WordPress 2.6, everytime you save a post, it is saved as a revision. All previous revisions are also saved. So, 10 revisions to a post will end up with 11 posts in the database. If you don’t need this revision history, and want to slim your database, add this code to your functions.php file: define('WP_POST_REVISIONS', false); Now, if you database is already full of previous revision, and you want to delete...
Show the Number of Queries and Load Time on a WordPress Site

Show the Number of Queries and Load Time on a Word...

To see the number of queries and the load time of a page, add this PHP code to the footer of your site: <?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.
Disable the AutoSave Feature in WordPress

Disable the AutoSave Feature in WordPress...

The autosave function in WordPress in useful in some cases. I prefer to turn it off though. To turn it off, open the function.php file that is in your theme directory and add the following code: <?php function disableAutoSave(){ wp_deregister_script('autosave'); } add_action( 'wp_print_scripts', 'disableAutoSave' );</code> ?>
Copyright Notice with Automatically Updating Year

Copyright Notice with Automatically Updating Year...

So you want the date in your copyright notice to automatically change each year? Use this code: <p> &copy; Copyright <?php echo date("Y") ?> Business Name Inc. All Rights Reserved. </p>
Stop WordPress from Removing br and p Tags

Stop WordPress from Removing br and p Tags...

WordPress has a bad habit of removing or reformatting br and p tags that are entered into posts and pages. It also does some other funky formatting that can be annoying at times. Well, here’s a way to fix this issue. Go into the theme editing area of WP admin. Add this code to your functions.php file, and save it. <?php function my_formatter($content) { $new_content = ''; $pattern_full = '{(\[raw\].*?\[/raw\])}is'; $pattern_contents...
Wordpress 2.5.1 Upgrade: Changed Files 2.5 to 2.5.1

Wordpress 2.5.1 Upgrade: Changed Files 2.5 to 2.5....

Disclaimer I cannot stress the crtical importance of making a full backup of your files and database before attempting to upgrade WordPress. Mistakes do happen, and things do break. Both are shortly followed by you banging your head and cursing. Save yourself the headache…Backup first, then upgrade! I should also mention that these files are being downloaded directly from the Wordpress Trac system. I did not package...