Add a favicon to your WordPress theme using wordpress hack

Just copy paste the following following lines to your function.php file.

function add_favicon() { ?>
<link rel=”shortcut icon” href=”<?php echo bloginfo(‘stylesheet_directory’) ?>/images/favicon.ico” >
<?php }
add_action(‘wp_head’, ‘add_favicon’);

if wp_head() function added in your header.php file, If that function not added then this hack will never work


How to add facebook, twitter, rss and email button in wordpress sidebar

First you need to download the social icons from website. Make sure icons are free.

I created following steps to add the icons to wordpress site for non developers.

1. Upload the icon image(s) to your media library.

2. Add a “Text” widget to your sidebar and insert code similar to the following:

<a href=””><img src=””  /></a>
<a href=””><img src=”” /></a>
<a href=””><img src=”” /></a>
<a href=””><img src=”” /></a>

Then just change the URLs so that they point to your icons and links. As you can see,

I have four icons in my sidebar (twitter, facebook, email, and rss).

Trick or hack for improving the WordPress site's performance.

Please use this tricks carefuly because First trick will cause issue to your wordpress site.

First Trick
Improve the  wordpress Blog’s Loading Speed

WordPress, by default, comes uncompressed and sends the uncompressed HTML to the visitor’s browser.
Create one file called “phpinfo.php” and then upload it to the root of your blog directory:

In phpinfo.php fine copy paste following code.

<?php phpinfo(); ?>

Check on server zlib is enabled or not.

Copy paste the following code in to your header.php file above the Doctype tag.

ini_set(‘zlib.output_compression’, ‘On’);
ini_set(‘zlib.output_compression_level’, ‘1’);

This trick will improve your speed upto 50%.

Code taken from following link :


Second Trick

Allow More Time For Slow Servers to Upgrade WordPress

Open the wp-admin/includes/files.php file and go to line 448.

For WordPressMU users path is wp-admin/includes/file.php and line no 450.

Find this line
$response = wp_remote_get($url, array(‘timeout’ => 60));

replace with

$response = wp_remote_get($url, array(‘timeout’ => 120));

This will change the server response time to 120 second.

Code taken from following link :

1000 free social networking vector icons

I found very useful links to find and download the social networking icons. In every website we required the social icons and vector images for using the site. I collected some we nice collection of social icons links.

There are indeed free high-quality icon sets. Through icons we can check the web designers and graphic artist’s skill.


I searched for facebook, twitter, feedburner, digg.

How to show tweetmeme button and facebook share button with the_excerpt function.

I created custom wordpress theme. In that theme I am using the_excerpt method for showing the post on some pages.
I installed the tweetmeme and facebook-share-new plugins and activated on wordpress site.
I saw one issue with these plugins. These plugins are showing on only single pages or posts.


Facebook and twitter button are not showing when I am using the the_excerpt() function.

I tried google but I did not got any suaitable answer. Everybody is saying about do mannual work when we creating the post.

So did checked the these plugins and I found the solution.

First I am taking about tweetmeme plugin. I opened the “tweetmeme.php” file. This file you will find in wordpress plugins and tweetmeme folder.

Add following code to line no 721 and comment the following line.

add_filter(‘the_excerpt’, ‘tm_update’);
//add_filter(‘get_the_excerpt’, ‘tm_remove_filter’, 9);

Add following code to line no 129
remove_action(‘the_excerpt’, ‘tm_update’);
When you done with changes you will be able to see tweetmeme button with wordpress post excerpt also.

Updated tweetmeme.php file you can download from here. Please right click and choose save as option.

Now I am going to talk about facebookshare plugin. I opened the facebookshare.php file. This file you will find in wordpress plugins facebook-share-new folder.

Add following code to line no 843

add_filter(‘the_excerpt’, ‘fb_share’);

When you done with changes you will be able to see facebookshare button with wordpress post excerpt also.

Updated facebookshare.php file you can download from here. Please right click and choose save as option.

457 Free WordPress Themes (amazing, excellent, High quality, Fresh,First class, beautiful, artistic,elegant, fresh-usable,clean)

I searched on smashingmagzine site I found about 457 wordpress themes. which all are choosen and good. URLs for as follows:


Have fun!

How to add www to domain name through apache or htaccess

Just use following code in apache configuration file or .htaccess file.

If you are using the shared hosting then please go with only .htaccess file.

Just copy paste following code in .htaccess file.

<IfModule mod_rewrite.c>

Options +FollowSymlinks

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.wordpressapi\.com$ [NC]

RewriteRule ^(.*)$$1 [L,R=301]


How to check iframes are loaded completely in browser

How to check iframes are loaded completely in browser

Many times we use the iframes in site for loading the some extra content. Some time we need trigger events when iframes are loaded on webpage.

In webpage loading Iframe and controlling site UI is very important.

This script is able to check local or cross domain iframe is loaded or not.

I tested following script with various browsers and OS. So there is no cross browser issue.

<script type="javascript"></p>
var iframe = document.createElement("iframe");
iframe.src = "";
if (navigator.userAgent.indexOf("MSIE") > -1 && !window.opera){
iframe.onreadystatechange = function(){
if (iframe.readyState == "complete"){

alert("Iframe is now loaded.");
} else {
iframe.onload = function(){

alert("Iframe is now loaded.");

How to check iframes are loaded completely in browser

How to check iframes are loaded completely in browser

Have fun!

Solved: header function issue with WordPress

If you are faceing issue with redirecting the one page or post to another page.

All PHP programmer always first try header() function. But when you use header function in worpdress that will not allow you to redirect the page.

Instead of using the header function please use wp_redirect() function which is provided by WordPress API.


global $post; // if outside the loop

if ( is_page() && $post->post_parent ) {

// This is a subpage

wp_redirect(get_option(‘siteurl’) . ‘/wp-login.php’);

} else {

// This is not a subpage

wp_redirect(get_option(‘siteurl’) . ‘/wp-login.php’);



Use following URLs for reference.