post

Defer parsing of javascript to improve performance in wordpress

Nothing for introduction, hehe! A very small snippet which will help you to defer parsing all javascript files except jquery in wordpress. Here is the code:

<?php
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
return "$url' defer ";
}
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );

You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name ‘mu-plugins’. If there is no folder in that name, then create a folder, name it ‘mu-plugins’, create a file inside that, give any name you like and paste the code in there. You don’t need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

A very simple jQuery slideshow – jSlider

Guys, this is a very simple jQuery slideshow, jSlider. Nothing special in naming, I just used a follower’s convention. This plugins have some configuration options. Let’s look at the code.

We just need one block element to implement the slideshow.

In here we just need to configure some options. Among those, images field are required to put the images path. Also for caption, we may have title, some text and url to redirect on.

Remember, we can’t put text/title/url for only one image, we need to put for all. In that case, if we don’t need we can use “” or # (in case of url).

Any more questions? Ask in the comment box.

Anyway, this plugin is free to use, just keep the author info at the top. :)

Why don’t you check the demo? ;)

DOWNLOAD FROM github

BeautyMenu: A simple jQuery drop down menu plugin


Fatal error: Uncaught Error: Call to a member function id() on array in /home/bappidgr/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php:36 Stack trace: #0 /home/bappidgr/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php(538): CrayonFormatter::format_code('', Array, Object(CrayonHighlighter)) #1 [internal function]: CrayonFormatter::delim_to_internal(Array) #2 /home/bappidgr/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php(516): preg_replace_callback('#()#msi', 'CrayonFormatter...', '<div id="wrappe...') #3 /home/bappidgr/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_highlighter.class.php(166): CrayonFormatter::format_mixed_code('<div id="wrappe...', Object(CrayonLang), Object(CrayonHighlighter)) #4 /home/bappidgr/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_highlighter.class.php(186): CrayonHighlighter->process() #5 /home/bappidgr/public_html/wp-content/plugins/crayon-syntax-highligh in /home/bappidgr/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 36