WordPress tip: Get rid of unused post revisions
Mar 9, 2010 CSS, HTML, JavaScript, PHP, Tutorials, Wordpress
Just run the following query on your WordPress database, and all revisions (As well as meta associated with it) will be deleted from your database. Of course, do not forget to make a backup of your database before running the code. DELETE a,b,c FROM wp_posts a WHERE a.post_type = ‘revision’ LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id); If you’d like to see more SQL queries for WordPress, make sure to read this post .
Direct Link Read the rest of this entry »
Tags: archives, article, banner, Code, contribute, CSS, Database, forum, HTML, JavaScript, order, repeat, SQL, themes, Tutorials
WordPress plugin: Protect your blog from malicious URL Requests
Mar 4, 2010 CSS, HTML, JavaScript, PHP, Tutorials, Wordpress
Paste the following code into a text file, and save it as blockbadqueries.php. Once done, upload it to your wp-content/plugins directory and activate it like any other plugins. That’s all! <?php /* Plugin Name: Block Bad Queries Plugin URI: http://perishablepress.com/press/2009/12/22/protect-wordpress-against-malicious-url-requests/ Description: Protect WordPress Against Malicious URL Requests Author URI: http://perishablepress.com/ Author: Perishable Press Version: 1.0 */ global $user_ID; if($user_ID) { if(!current_user_can(‘level_10′)) { if (strlen($_SERVER['REQUEST_URI']) > 255 || strpos($_SERVER['REQUEST_URI'], "eval(") || strpos($_SERVER['REQUEST_URI'], "CONCAT") || strpos($_SERVER['REQUEST_URI'], "UNION+SELECT") || strpos($_SERVER['REQUEST_URI'], "base64")) { @header("HTTP/1.1 414 Request-URI Too Long"); @header("Status: 414 Request-URI Too Long"); @header("Connection: Close"); @exit; } } } ?> Thanks to Jeff Starr for this great plugin! Do you know that Digging into WordPress , Jeff’s book, has just been updated?
Direct Link Read the rest of this entry »
Tags: archives, article, banner, canvas-theme, contribute, CSS, HTML, JavaScript, order, PHP, purchase, Security, themes, wordpress-discounts
WordPress tip: Create a PDF viewer shortcode
Mar 1, 2010 CSS, General, HTML, JavaScript, PHP, Tutorials, Wordpress
The first step is to paste the following code into your functions.php file: function pdflink($attr, $content) { return ‘<a class="pdf" href="http://docs.google.com/viewer?url=’ . $attr['href'] . ‘">’.$content.’</a>’; } add_shortcode(‘pdf’, ‘pdflink’); Once you saved the file, you’ll be able to use the shortcode on your posts and page.
Direct Link Read the rest of this entry »
Tags: archives, article, canvas-theme, contribute, CSS, forum, HTML, order, pdf, purchase, repeat, shortcode, themes, Tutorials, wordpress-discounts
WordPress Theme Releases for 02/13
Feb 13, 2010 Ajax, CMS, CSS, General, HTML, JavaScript, PHP, Resources, Tutorials, Wordpress
Malleable Hybrid child theme that offers news-type functionality that features a configurable slider and address (with microformats). Intrepid Two-column with a right sidebar, compatible with WordPress version 2.8 upwards, with threaded and paged comments. 3 styles of pastel shades to choose from – blue-green, green-brown and purple-gray as default… You can also replace the header completely with your own image.
Direct Link Read the rest of this entry »
Tags: archives, CMS, CSS, HTML, japanese, JavaScript, press-theme, Theme, themes, updated-plugin, WordPress themes
How to Do ‘XYZ’ Without a WordPress Plugin
Feb 13, 2010 Ajax, CMS, CSS, General, HTML, JavaScript, PHP, Resources, Tutorials, Wordpress
If you do a quick Google search for, “without a plugin”, you’ll find a gazillion results for how to accomplish simple to complex tasks for WordPress without the need of a plugin. With so many articles about not using WordPress plugins, it just begs the question: “What’s wrong with WordPress plugins in the first place?” I personally love my installed plugins. I have 25 installed on my personal blog, and I couldn’t live without a single one of them.
Direct Link Read the rest of this entry »
Tags: Ajax, archives, CMS, CSS, plugins, press-plugin, Resources, ronald-huereca, Theme, videos, wordpress plugins
The Good, the Bad and the Ugly of The GPL Model
Feb 10, 2010 CMS, CSS, General, HTML, JavaScript, PHP, Wordpress
I’ll cut right to the chase… I have a love hate relationship with the GPL model. I’ve adopted it because my primary CMS of choice is WordPress which is licensed under the GPLv2. It’s easy to argue that open nature of the GPL has been largely responsible for the success of WordPress, particularly in it’s growth over the past few years.
Direct Link Read the rest of this entry »
Tags: archives, archives-news, CSS, news, Popular Posts, press-theme, transliteration, videos
WordPress.com Introduces Import from Posterous
Feb 9, 2010 Ajax, CMS, CSS, General, HTML, JavaScript, PHP, Resources, Tutorials, Wordpress
Having several blogs can be a bit hard to maintain, and micro blogging services like Posterous and Tumblr provide a quicker way to post content to the web. However, WordPress has added features which are similar to Posterous, in the form of posting by email to WordPress.com blogs. If you have started using that feature and are looking to import data from your old Posterous blog to your WordPress.com blog, you will now be able to do it using the Posterous importer.
Direct Link Read the rest of this entry »
Tags: Ajax, archives, business, CMS, HTML, JavaScript, PHP, posterous, press-com-introduces, Resources, Tools, Tutorials, videos, wordpress tools
How to automatically use resized images instead of originals
Feb 7, 2010 CSS, General, HTML, JavaScript, PHP, Tutorials, Wordpress
Simply paste the following code on your functions.php file and save it. No other action is needed! function replace_uploaded_image($image_data) { // if there is no large image : return if (!isset($image_data['sizes']['large'])) return $image_data; // paths to the uploaded image and the large image $upload_dir = wp_upload_dir(); $uploaded_image_location = $upload_dir['basedir'] . ‘/’ .$image_data['file']; $large_image_location = $upload_dir['path'] .
Direct Link Read the rest of this entry »
Tags: archives, contribute, Design, forum, JavaScript, oops, PHP, purchase, themes, Tutorials, wordpress-discounts
How to automatically remove the Nofollow from your posts
Feb 3, 2010 CSS, General, HTML, JavaScript, PHP, Tutorials, Wordpress
Copy the following code, and paste it on the functions.php file from your theme. Once you saved the file file, the rel=”nofollow” attributes will be removed. function remove_nofollow($string) { $string = str_ireplace(‘ rel=”nofollow”‘, ”, $string); return $string; } add_filter(‘the_content’, ‘remove_nofollow’); Thanks to Jeff Starr for this awesome piece of code.
Direct Link Read the rest of this entry »
Tags: archives, article, banner, book, contribute, HTML, JavaScript, nofollow, PHP, purchase, repeat, themes, Tutorials, wordpress-discounts






