How to remove login shake effect when error occurs

April 3, 2014 at 4:53 pm

Don’t like the “shake” effect which occurs each time a login error occurs? Here is a super easy snippet to remove it for good.

Simply paste the following code into your functions.php file:

function wps_login_error() {
        remove_action('login_head', 'wp_shake_js', 12);
add_action('login_head', 'wps_login_error');

Credit: WordPress Support Forum

MightyDeals giveaway: 3 WordPress themes bundle to win

March 27, 2014 at 12:15 pm

Long time with no giveaway here on WpRecipes! Today, my partners from MightyDeals are offering you the chance to win a bundle of 5 amazing WordPress themes. Just read, and join if you want to win!

A word about Mighty Deals

Mighty Deals offers unbelievable deals and discounts for creative professionals.The deals include products and services that are heavily discounted, exclusively for Mighty Deals customers, usually from 50% to 90% off. Each deal stays on the site for a very limited time and is available exclusively for purchase directly through the site.

The prize: DesignerThemes themes bundle

On this giveaway, you can win an amazing bundle of 5 gorgeous, high-quality WordPress themes. Their beauty is more than skin deep, though, as these themes are built on a responsive design, include an intuitive options panel, are highly customizable, SEO friendly and more! Wanna know more about the bundle? Then just have a look there!

How to join the contest?

Taking part in the contest is super easy: Just leave a comment on this post to let us know you’re in. In one week (April 2, 2014) I’ll randomly pick 3 winners which will receive designerthemes bundle directly from MightyDeals.

WordPress tip: Bulk delete comments with a specific url

March 14, 2014 at 5:54 pm

Even if you’re careful when approving new comments, sometimes you might just forget to visit the commenter url and detect a long time after that the linked site is spammy. Here is a very easy way to bulk delete all comments with a specific url, using a simple SQL query.

Just run the following query on your WordPress database to delete comments with nastyspamurl as url. Don’t forget to replace the table prefix wp_ if your database is using another prefix.
And of course, create a backup of your database before running the query!

DELETE from wp_comments WHERE comment_author_url LIKE "%nastyspamurl%" ;

How to set the default image size in WordPress galleries

March 11, 2014 at 6:07 pm

By default, built-in WordPress galleries use the size “full” for the image but in some cases it’s better set a different size. Here is an easy to use code snippet to set the default image size in your galleries.

Simply paste the following snippet into your functions.php file:

add_shortcode('gallery', 'custom_size_gallery');
function custom_size_gallery($attr) {
     $attr['size'] = 'medium';
     return gallery_shortcode($attr);

The desired size can be changed on line 5.

Thanks to emoticode for the cool tip!

How to change the title attribute of WordPress login logo

February 21, 2014 at 2:51 pm

This little snippet will change the title attribute text when you hover over the WordPress logo on the login page. Super easy and very useful when working on a site for a client.

Simply paste the following code snippet into your functions.php file. Title text can be customized on line 2.

function  custom_login_title() {
        return 'Your desired text';
add_filter('login_headertitle', 'custom_login_title');

Thanks to Dave Clements for this code!

Easily delete WordPress post revisions using your fuctions.php file

February 10, 2014 at 6:35 pm

Post revisions are super useful sometimes, but from time to time you might want to clean your database. Here’s a super easy way to delete all posts revisions.

Open you functions.php file and paste the following code:

$wpdb->query( "
DELETE FROM $wpdb->posts
WHERE post_type = 'revision'
" );

Save the file and open your blog homepage to run the code. Once done, there’s no need to keep the code snippet in your functions.php file, as it will always delete all post revisions. So simply remove it.

Thanks to Hardeep Asrani for the tip!

Sponsored post: 3 WordPress premium plugins for $39

January 29, 2014 at 2:01 pm

Need to create a newsletter? Or sell stuff online? Or maybe you want to offer banner advertising on your site? How about all three? Our partner Mighty Deals just have a very cool deal in store for WordPress users: A bundle of three awesome WordPress plugins from Tribulant to help you do all three!

I rarely publish sponsored posts on my blogs, but today here’s a very good deal that can benefit to many of you. For $39, Mighty Deals let you download a bundle of 3 premium plugins from Tribulant.

Those 3 plugins are:

  • The WordPress Newsletter plugin, which gives you the ability to accept subscriptions on your WP website and send out mass newsletters to your mailing list(s).
  • The WordPress Shopping Cart plugin, which transforms a simple WP website into an e-commerce site that can sell products and accept payments directly via PayPal, 2CheckOut, MoneyBookers, and more.
  • The WordPress Banner Rotator plugin, with which you can quickly and seamlessly place image, Flash, and code banner ads on your WP website’s front-end using either sidebar widgets, post/page embedding, and/or hard-coding directly into your theme.

Want to know more about those plugins? Then just have a look at this page where you can learn more and buy.

WordPress snippet: breadcrumb without plugin

January 28, 2014 at 7:27 pm

If you want to add a breadcrumb to your blog, you can use one of the many available plugins to do so. But why using a plugin when you can easily code it yourself? Here’s a ready to use code snippet to add a breadcrumb to your WordPress blog.

Open your functions.php and paste the code below in it:

function the_breadcrumb() {
                echo '<ul id="crumbs">';
        if (!is_home()) {
                echo '<li><a href="';
                echo get_option('home');
                echo '">';
                echo 'Home';
                echo "</a></li>";
                if (is_category() || is_single()) {
                        echo '<li>';
                        the_category(' </li><li> ');
                        if (is_single()) {
                                echo "</li><li>";
                                echo '</li>';
                } elseif (is_page()) {
                        echo '<li>';
                        echo the_title();
                        echo '</li>';
        elseif (is_tag()) {single_tag_title();}
        elseif (is_day()) {echo"<li>Archive for "; the_time('F jS, Y'); echo'</li>';}
        elseif (is_month()) {echo"<li>Archive for "; the_time('F, Y'); echo'</li>';}
        elseif (is_year()) {echo"<li>Archive for "; the_time('Y'); echo'</li>';}
        elseif (is_author()) {echo"<li>Author Archive"; echo'</li>';}
        elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "<li>Blog Archives"; echo'</li>';}
        elseif (is_search()) {echo"<li>Search Results"; echo'</li>';}
        echo '</ul>';

Once done, open header.php and call the function:

<?php the_breadcrumb(); ?>

Thanks to emoticode for this snippet!

ThemeFuse giveaway: 3 premium WordPress themes to win

January 16, 2014 at 6:52 pm

The innovators at ThemeFuse have been generous enough to provide three premium WordPress themes that will be shared with you – our readers! What an exciting way to start your day!

A word about Themefuse

ThemeFuse is one of the most popular actors in the premium WordPress themes market. They provide lots of themes with a great design and solid code.
They have lots of different designs for lots of different needs, so you should definitely have a look to their website!

How to enter the giveaway

Scroll down to the bottom of this very post, and leave a comment for us. Tell us how you would implement your new WordPress theme, and why you should be one of our three winners.

Head over to Twitter and spread the word to your followers about this giveaway by tweeting: Win a free copy of @ThemeFuse #WordPress Theme from @catswhocode (RT to Enter).

Let your Facebook friends know how much you enjoy ThemeFuse by visiting the ThemeFuse Facebook page and clicking the “Like” button.

The three winners will be announced here in one week (January 23, 2014), so stay close!

How to bring back single-column dashboard in WordPress 3.8

December 20, 2013 at 6:06 pm

WordPress 3.8 introduces a new way to display the dashboard. If you don’t like it and would love to bring back the good old single-column dashboard, here’s a quick tip for you.

Bringing back the single-column dashboard in WordPress 3.8 is pretty easy: just add this code to your theme’s functions.php file.

// force one-column dashboard
function shapeSpace_screen_layout_columns($columns) {
	$columns['dashboard'] = 1;
	return $columns;
add_filter('screen_layout_columns', 'shapeSpace_screen_layout_columns');

function shapeSpace_screen_layout_dashboard() { return 1; }
add_filter('get_user_option_screen_layout_dashboard', 'shapeSpace_screen_layout_dashboard');

Thanks to Jeff Starr for the tip!