Snippets | Plugins | Themes | Hacks

Dismissing the welcome panel in wordpress multisite

I was working on a multisite project and found that everytime I create a new site and login to the new site, I was shown a wordpress welcome panel (screen) like below


Now it was a bit overwhelming for me (and hopefully it will be the same for new users). So I was searching for something that can help me remove this welcome panel. So I thought of trying my hand on writing a brand new plugin (yeah you read it correct, I am writing my first plugin)

I will update this link, once its approved on wordpress.

So basically this plugin removes the welcome panel for wordpress multisite. It will have no impact on wordpress singles sites.

Kindly comment and let me know what do you think about the plugin, this will help me to come up with more plugins in future.

Disable wordpress plugin updates

Many a times you want that the plugins you have installed should not show updates. May be because you have modified the plugin for your client’s work or you are doubtful that if the client updates the plugin, it could break the existing site. So what you can do is simply add the following code snippet into your functions.php file and you will disable wordpress plugin updates.
Remember to put the code snippet below to your functions.php without the <php> tag :) as it will already be there ;) (just mentioning this so that someone who is new to wordpres is not zapped!!)

remove_action( ‘load-update-core.php’, ‘wp_update_plugins’ );
add_filter( ‘pre_site_transient_update_plugins’, create_function( ‘$a’, “return null;” ) );

Hope you liked the code snippet. More coming your way!!

Load JQuery in footer in WordPress

Those who know wordpress inside out, might be aware that by default WordPress has registered the JQuery Library to load in the header. But using the code snippet below, it changes the behaviour.

Use the following code in functions.php

     * Prints jQuery in footer on front-end.
    function ds_print_jquery_in_footer( &$scripts) {
        if ( ! is_admin() )
            $scripts->add_data( ‘jquery’, ‘group’, 1 );
    add_action( ‘wp_default_scripts’, ‘ds_print_jquery_in_footer’ );


The need of loading Jquery in footer is high performance.

When we have JQuery script loading in header by default for wordpress, progressive rendering is blocked for all content below the script. Moving scripts as low in the page as possible (here we are loading it in footer) means there’s more content above the script that is renedred sooner and user experience is better.

Additionally, the other problem caused by scripts is that it blocks parallel downloads.

Hope you liked it. Some more useful code snippets coming soon!

Dynamic QR code with your WordPress post/article link

QR codes are everywhere these days. So how about having a QR code for your wordpress articles? Sounds interesting, correct? There are wordpress plugins available for doing this, but here is a simple code snippet that can help you with the same. It will work as automatic QR code generator for your wordpress articles.

Below is the code snippet:

<img src=”×150&data=”&lt;?php the_permalink(); ?>” alt=”QR Code for <?php the_title(); ?>”/>

Just add the above snippet and get dynamic QR codes for your articles.
A few key points:

  • QRServer is a free service for personal use
  • You can select the size of your QR code. If you see in the snippet, there is a parameter as size, you can change the size there. Remember that the QR code should be square. The minimum size allowed is 10×10 and max is 1000×1000
  • If you pass a wrong/invalid value, it will by default generate a QR code with size 200×200

Simple, correct? Don’t forget to comment and share if you liked it.

WordPress Code Snippets – how to use

In my last post, Introduction to WordPress Code Snippets, I explained a bit about wordpress code snippets. Just to give you a brief overview, code snippet is a small piece of code to attain the desired functionality.

When we use a plugin, we are actually having a function to perform a desired functionality. Now some features are so small that you actually don’t need a plugin for that. Instead you can use a code snippet and get the desired functionality.

For almost every theme, there is a file called functions.php. We will have to insert the code snippet to that functions.php If your theme doesn’t have, create a new file named functions.php and start using the code snippets.

Feel free to drop a comment if you have any questions.



Get every new post delivered to your Inbox.