Put Google Analytics code into your wordpress theme

Adding Google Analytics is important for website. Here in this article we given code snippet and show to Put Google Analytics code into your wordpress theme

Put Google Analytics code into your wordpress theme

Copy paste following lines to your wordpress theme folder’s functions.php file.


function google_analytics() {

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-12453889-1");
pageTracker._trackPageview();
} catch(err) {}</script>
}
add_action('wp_footer', 'google_analytics');

Dont forget to replace your google analytics code in google_analytics code.

Put Google Analytics code into your wordpress theme
Put Google Analytics code into your wordpress theme

have fun!

Change WordPress login logo using wordpress hack

If you want to Change WordPress login logo using wordpress hack. Just copy paste following lines to your wordpress theme folder’s functions.php file for this. There is very small code snippet you need put in your wordpress theme.

Change WordPress login logo using wordpress hack

function change_login_logo() {
echo ‘<style type=”text/css”>
h1 a { background-image:url(‘.get_bloginfo(‘template_directory’).’/images/logo.png); }
</style>’;
}

add_action(‘login_head’, ‘change_login_logo’);

Change WordPress login logo using wordpress hack
Change WordPress login logo using wordpress hack

have fun!

how to add favicon to wordpress theme

Favion is small image icon which is shown on browser left top side. Left side of browser address bar, we can see the favicon image. Here in this article We will show you, how to add add favicon to wordpress theme.

how to add favicon to wordpress theme

Create favicon image using photoshop or any photo editing tool. Favicon image side should be 16x16px or 32x32px. Many times favicon image should be .ico or png format. All latest browser are able to show png format image but in old browser icon format image should be supported.

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

<?php 
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

Or you can just add favicon image file in themes folder and use following code in header.php file.


<link rel="icon" href="https://purabtech.in/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="https://purabtech.in/favicon.ico" type="image/x-icon" />

how to add favicon to wordpress theme
how to add favicon to wordpress theme

How to add social media buttons to wordpress sidebar

First you need to download social icons. Make sure icons are free. add social media buttons to wordpress sidebar Using simple HTML code, given by us. You just need copy and paste following code in to your sidebar text wordpress widget.

How to add social media buttons to wordpress sidebar

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

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

How to add social media buttons to wordpress sidebar
How to add social media buttons to wordpress sidebar

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


<a href="http://twitter.com/wordpressapi"><img src="http://images.purabtech.in/twitter_48x48.png" alt="" /></a><a href="facebook.com/wordpressapi"><img src="http://images.purabtech.in/facebook_48x48.png" alt="" /> </a>
<a href="mailto:support@purabtech.in/files/"><img src="http://www.wordpress.com/wp-content/uploads/email_48x48.png" /></a> 
<a href="http://images.purabtech.in/feed/"><img src="http://images.purabtech.in/rss_48x48.png" /></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).

Tricks for improving WordPress site performance

WordPress, by default, comes uncompressed and sends the uncompressed HTML to the visitor’s browser. we given some Tricks for improving WordPress site 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

Tricks for improving WordPress site performance

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.


<?php
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 :
http://www.wprecipes.com/compress-wordpress-output-and-speed-your-blogs-load-speed

Tricks for improving WordPress site performance
Tricks for improving WordPress site performance

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 :
http://www.wprecipes.com/wordpress-upgrade-allow-more-time-for-slow-servers

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.

1000 free social networking vector icons

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

1000 free social networking vector icons
1000 free social networking vector icons

http://www.thedesigncubicle.com/2009/04/600-free-design-twitter-and-social-media-icons-a-collection-motherload/

http://sherifabdou.com/2009/03/60-free-vectors-icons-for-web-designers/

http://www.blogreign.com/2009/06/16-sets-amazing-social-networking-icons-free-download/

http://webtreats.mysitemyway.com/154-free-glassy-space-social-networking-icons/

http://sherifabdou.com/2009/03/60-free-vectors-icons-for-web-designers/

http://digg.com/design/Free_Social_Network_Icons

http://designreviver.com/freebies/6-free-new-social-icons-digg-twitter-stumble-rss-delicious-reddit/

http://www.komodomedia.com/blog/2009/06/social-network-icon-pack/

http://www.smashingmagazine.com/2008/03/06/35-really-incredible-free-icon-sets/

I searched for facebook, twitter, feedburner, digg.

show tweetmeme button and facebook share button

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.

show tweetmeme button and facebook share button
show tweetmeme button and facebook share button

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’);
tweetmeme
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, High quality

Here are links for 457 Free WordPress Themes amazing, High quality. I searched on smashingmagzine site I found about 457 wordpress themes. which all are chosen and good.

457 Free WordPress Themes amazing, High quality

URLs for as follows:

http://www.smashingmagazine.com/2009/05/18/100-amazing-free-wordpress-themes-for-2009/

http://www.smashingmagazine.com/2008/01/08/100-excellent-free-high-quality-wordpress-themes/

http://www.smashingmagazine.com/2009/11/12/40-free-high-quality-wordpress-themes/

http://www.smashingmagazine.com/2007/03/29/8-fresh-and-clean-wordpress-themes/

http://www.smashingmagazine.com/2008/03/25/15-more-free-first-class-wordpress-themes/

http://www.smashingmagazine.com/2008/08/25/30-free-high-quality-wordpress-themes/

http://www.smashingmagazine.com/2007/02/09/83-beautiful-wordpress-themes-you-probably-havent-seen/

http://www.smashingmagazine.com/2007/08/28/45-excellent-blog-designs/

http://www.smashingmagazine.com/2007/06/26/21-fresh-usable-and-elegant-wordpress-themes/

http://www.smashingmagazine.com/2007/05/07/10-fresh-elegant-and-clean-wordpress-themes/

wordpress-logo-shine

 

Have fun!

How to add twitter follower logo on blog

If you have twitter acctount, just login to that account and go to bottom page twitter page and click on or just click on following link.

How to add twitter follower logo on blog

http://twitter.com/goodies/buttons

Choose any botton as per your choise and click on that.

How to add twitter follower logo on blog
How to add twitter follower logo on blog

Copy the code from the text box and paste that code in your blog’s widget- text widget. That sit.

Have fun!

add www to domain name through apache or htaccess

We given the detailed information about how to add www to domain name through apache or htaccess. Using apache rule we can achieve this.

add www to domain name through apache or htaccess
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 ^(.*)$ http://www.purabtech.in/files/$1 [L,R=301]

</IfModule>