Increase mobile visitors on your WordPress blog »

Once done, simply open your header.php file and place the following at the top of the file. Don’t forget to edit line 5 according to the page where you’d like to redirect mobile users. include('mobile_device_detect.php'); $mobile = mobile_device_detect(); if ($mobile==true) { header( 'Location: http://your-website.com/?theme=Your_Mobile_Theme' ) ; }

Load jQuery in the footer »

Paste the following code in your functions.php file, save it, and you’re done . 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' );

Automatically insert a list of related articles below the post »

First, paste the code below into the functions.php file from your theme. // "More from This Category" list by Barış Ünver @ Wptuts+ function wptuts_more_from_cat( $title = "More From This Category:" ) { global $post; // We should get the first category of the post $categories = get_the_category( $post->ID ); $first_cat = $categories[0]->cat_ID; // Let's ...

jQuery browser detection »

Here’s a tasty little snippet for adding custom browser classes using jQuery. This code checks for common browser types and adds a named class to the element. custom browser classes $(document).ready(function(){ if (navigator.userAgent.indexOf('Mac OS X') != -1) { // Mac if ($.browser.opera) { $('html').addClass('opera'); } if ($.browser.webkit) { $('html').addClass('webkit'); } if ($.browser.mozilla) { $('html').addClass('mozilla'); } ...

Easily make WordPress images responsive »

Open your functions.php file and paste the following code in it: function responsive_images($atts, $content = null) { return ' ' . $content .' '; } add_shortcode('responsive', 'responsive_images'); Once done, open your style.css file and add those CSS rules: @media only screen and (max-width:767px) { .image-resized img { width:100%; height:auto; } }