Alexa Rank Widget WordPress plugin

We Created Alexa Rank Widget wordpress plugin. This plugin is open source and any one can freely download this wordpress plugin.

How to Install Alexa Rank Widget WordPress plugin?

Follow the steps below to install the plugin.

  1. Upload the Alexa Rank Widget directory to the /wp-content/plugins/directory
  2. Activate the plugin through the ‘Plugins’ menu in wp
  3. Go to “Alexa Rank Widget” option to configure the button

Alexa Rank Widget WordPress plugin

Here we are giving you the brief description about Alexa Rank Widget wordpress plugin.
The Alexa Rank Widget easily allows to add widget in wordpress sidebar.
This widget will give to control the website name how you want to show the alexa widget in your sidebar.
using this plugin you will get show options for showing the Alexa rank in side bar.
1. Squre – Button  (120 x 95)
2. Vertical – Vertical Banner  (120 x 240)

As we in today’s date showing Alexa web ranking is important for SEO and for attracting your advertiser and viewer.

This information is good for site owner as well as viewer.

Here you can see Some screen shots of Alexa Rank Widget:

1. Preview of Alexa Rank Widget with image and rank with squre box.

Alexa Rank Widget WordPress plugin
Alexa Rank Widget WordPress plugin

2. Preview of Alexa Rank Widget with image and rank with verticle box.

3. Alexa Rank Widget admin panel for your configration of your button as per your choice

Alexa Rank Widget WordPress plugin
Alexa Rank Widget WordPress plugin

You can download Alexa Rank Widget from following URL:

Alexa Rank Widget : Download

Official URL of Alexa Rank Widget wordpress plugin:

http://wordpress.org/extend/plugins/alexa-rank-widget/

Create fixed side or top buttons in wordpress theme

We can easily introduce fixed side buttons in wordpress or any website. In this article I given code snippet for Create fixed side buttons in wordpress.

Create fixed side buttons in wordpress

Fixing the position of any document element using CSS this is very old technique but still  I am going to give you some good trick to show the twitter button or search buttons or add new button on bottom or sidebar.

Using following CSS code you can integrate the any button on sidebar.


#submit_news { background:transparent url(images/submit-news.png) no-repeat scroll 0px 0px; height:170px; left:0; position:fixed; top:180px; width:40px; }
div#submit_news:hover { background-position:-41px 0px; }
#submit_news a{ display:block; height:170px; width:40px; }

In this tutorial we are using the only one image as a button. As we know we are using the sprite image css here.

Open your header.php file from wordpres theme. and under body tag put following code.

<div id=”submit_news”><a href=”/submit-news” ></a></div>

First you need to create the submit news page in wordpress.

If you want to add the submit news button for your site you can download from here.

get alexa rank using php code

There is nice wordpress plugin which will help you to add alexa rank in your website. In this article, we briefly explained to get alexa rank using php code

get alexa rank using php code

if you want to check the your website ranking as per alexa so you can use the following code in your php projects. There is very nice wordpress plugin which will help you to add the alexa rank in wordpress site. In this article I given PHP code for adding the alexa rank block on any website.

Alexa Rank Widget

http://data.alexa.com/data?cli=10&dat=s&url=wordpressapi

“http://data.alexa.com/data” this file will return the xml format output. Using the XML output or reading xml file we can easily fetch the our or any website ranking.

Use the following function for getting the alexa website ranking.

<?php
function AlexaRank( $url )
{
preg_match( '#<POPULARITY URL="(.*?)" TEXT="([0-9]+){1,}"/>#si', file_get_contents('http://data.alexa.com/data?cli=10&dat=s&url=' . $url), $p );
return ( $p[2] ) ? number_format( intval($p[2]) ):0;
}

echo "purabtech.in/files/ Rank as per alexa.com: ";
echo AlexaRank('purabtech.in/files/');

?>

if you want to check the multiple website ranking in one shot than use the following PHP code.

<?php
$domains = array( 'google.com', 'ask.com', 'yahoo.com', 'bing.com' );

foreach ( $domains as $domain )
echo $domain, ' - ', AlexaRank( $domain ), '<br />', PHP_EOL;

?>
get alexa rank using php code
get alexa rank using php code

Have fun!

How to use file functions in php

In this tutorials I will show you How to use file functions in php, how to read the file and write the file using php functions.

First make test.txt file and put some dummy content in that file.

Note: Make test.txt file group permission to 777 or writeable and readable.

<?php
$fp = fopen("test.txt","w");
 while(!feof($fp))
 {
 $data = fgets($fp);
 echo "alert($data);";
 }
 fwrite($fp, 'this is test text');
 fclose($fp);
?>

Using following function You are able to check the file size.

$fp = fopen('test.txt', 'r');
echo $data = fread($fp, filesize('test.txt'));
fclose($fp);
How to use file functions in php
How to use file functions in php

wordpress create archive page for wordpress theme

Given code for wordpress create archive page for wordpress theme. search engine sites will look for two main file. First sitemap.xml file and archive page. First I would say somthing about archive page in any website. Archive page is very important for SEO purpose.

Create an Archive Page in your WordPress theme

If you do not having archive page in your website so you are lacking somewhere in SEO for your website.  What I am going to show in this article, How to create the archive page for worpdress theme or website.  In wordpress creating the archive is very easy.

Follow my steps to create the archive page in wordpress site.

  • Open your wordpress theme folder and copy the single.php as named archive.php
    Note: dont copy index.php file as archive.php. It may have different UI and programming attribute in index.php.
  • Then copy archive.php as archive_template.php new file.
  • Open the archive_template.php file and copy paste the following code in top of file.
<?php
/*
Template Name: Archives Page
*/
?>
  • Again open the archive_template.php file and find the post loop. Between the loop copy past the following code.
<h1> All Archives in dropdown</h1>
<select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'>
 <option value=""><?php echo attribute_escape(__('Select Month')); ?></option>
 <?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select>

<br><br>
<h1> All category</h1>
<ul><?php wp_list_cats('sort_column=name&optioncount=1') ?></ul>

<br><br>
<h1> All Archives</h1>
<ul><?php wp_get_archives('type=monthly&show_post_count=1') ?></ul>

Above code will give you the archive with dropdown and archive with category name with post count and archive with month and post count.

  • After doing this upload two new files to server in wordpress theme folder (archive.php and archive_template.php).
  • Go to your wordpress Admin panel using browser
  • Create the new page with title “Archive” and put some information about your website in that page.(Dont publish the page wait and follow next steps.)
wordpress create archive page for wordpress theme
wordpress create archive page for wordpress theme
  • Check the template section (right side under attribute section). Choose archive page as template and publish and save the page.

That sit. You are able to see the archive page for your website.

We just launched the Yahoo Buzz wordpress plugin

Few minutes back we just launched the Yahoo Buzz wordpress plugin. We developed the Yahoo buzz button plugin for social networking purpose. This plugin is free to download. Yahoo Buzz plugin will give you the power to connect with yahoo buzz to your wordpress blog or website.

Yahoo Buzz wordpress plugin

The yahoo Buzz will easily allows to add the yahoo buzz button your blog to be shared. this will give the admin control to where to show the yahoo buzz button in the post. This plugin has facility to choose where to show the button.

This plugin will give more control to edit and customize the CSS as per your choice for yahoo buzz button to show. This button will show the count of yahoo buzz did by the users.

Yahoo button will share your wordpress articles into yahoo buzz and this will give you more traffic to your wordpress blog. This is very SEO friendly wordpress plugin. You must add this plugin to your wordpress blog. This yahoo buzz button will give very cool look to your site also.

As we know now Yahoo is second number search engine in the world. So adding this buzz button will be helpful to become your wordpress website more socialite.

See some cool screen shots of Yahoo buzz plugin.

Admin panel Screen Shot.

Front End screen Shot

You can freely download the Yahoo Buzz wordpress from here : Yahoo Buzz

The Official Yahoo Buzz WordPress plugin URL is as follows:

http://wordpress.org/extend/plugins/yahoo-buzz/

How to get first category name or id from wordpress post

Many people want to know about post category and know more information current category. Some time we need to use the first category of wordpress post. As we know we can define the multiple category to single article. So if we want retrive the wordpress category then we will get the result in simple php array format. Using that array we can easily extract the first category of post.

if we want first category than, we will get result in php array format. Using that array we can easily get first category name or id from wordpress post.

How to get first category name or id from wordpress post

In this post I will show how we can achieve that. Using following code we can get the first category ID.

< ?php
$category = get_the_category();
$currentcat = $category[0]->cat_ID;
?>

Using following code we can extract the first category name from the wordpress post.

< ?php
$category = get_the_category();
$currentcat = $category[0]->cat_name;
?>

Above code we can use only in the loop but using the following code we can extract the category
outside the loop also

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
global $post;
$categories = get_the_category($post->ID);

$currentcat = $category[0]->cat_ID;
?></pre>
<pre>

same like that.. cat name

 <!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
 global $post;
 $categories = get_the_category($post->ID);

$currentcat = $category[0]->cat_name;
 ?>

</pre>
<pre>
How to get first category name or id from post
How to get first category name or id from post

add event to all image elements using javascript

In this article we will show to attach event to DOM element and add event to all image elements using javascript. Using javascript we can attach the event to any dom element.

add event to all image elements using javascript

You many times heard about getElementsByTagName javascript method but you did not tried.

getElementsByTagName function is very useful when you are working with javascript events. Using this function you can attach the event to any tag which is present in HTML body.

Here I am going to give the image example. Following script will attach the mouseover event to all images which are present in DOM.


var all_images = document.getElementsByTagName('img');

for (var i = 0; i < all_images.length; i++) {

addEvent(all_images[i], 'mouseover', myfunction, false);

}

function myfunction () {

 alert('this is image mouse over alert');

}

/**
 * cross-browser event handling for IE5+, NS6 and Mozilla
 * By Scott Andrew
 */
//This addEvent function we are using for external class use
this.addEvent = function(elm, evType, fn, useCapture) {
 if (elm.addEventListener) { // Mozilla, Netscape, Firefox
 elm.addEventListener(evType, fn, useCapture);
 return true;
 } else if (elm.attachEvent) {  // IE5 +
 var r = elm.attachEvent('on' + evType, fn);
 return r;
 } else {
 elm['on' + evType] = fn;
 }
}

</script>
add event to all image elements using javascript
add event to all image elements using javascript

If you copy paste the following code in your document and If you mouseover on any image then alert with message will come.

This script will work in any browsers. (IE 6,7,8, FF3,2, Safari3,4)

How you can disable Google Buzz

last week google launched the google buzz to challenge the  twitter. Google buzz got really huge amount of response. Now they did some modification in application so that will be easy to disable the unwanted google buzz.

How you can disable Google Buzz

Google’s engineers made some quick changes as a result of the backlash, including a security flaw affecting mobile Buzz users, a setup process that has you manually accepting followers, and an easier way to disable Buzz

You can disable the google buzz following these steps.

1. login to your gmail account first.

2. Click on setting button (right top side)

3. choose buzz option and choose your settings as per your choice.

How you can disable Google Buzz
How you can disable Google Buzz

Using following setting google really saving the people privacy.

how to add google connect to your wordpress site

Many people want to add google connect to your wordpress site. But they don’t know how to achieve that.  In this article I am going to show you the step about adding the google connect to your site.

how to add google connect to your wordpress site

Google friend connect is the best feature to add in your site and increase your blog visits.

First go following URL:

http://www.google.com/friendconnect/home/

login to google friend connect.

how to add google connect to your wordpress site
how to add google connect to your wordpress site

Click on get started button and login with your gmail account.

Then click on ‘Set Up A New Site’ button.

Fill your website URL and information in form and click on next button.

After that you will get the congratulation window.

how to add google connect to your wordpress site
how to add google connect to your wordpress site

Then you will get the configuration page for google connect and you should choose colors and text color settings as per your website. Dont forget to choose or set the width of widget.

Finally click on “generate code” button and you will get the google connect code for your wordpress website.

how to add google connect to your wordpress site
how to add google connect to your wordpress site

Note: This javascript code will never run in test machine. If you want to see the google connect widget then put javascript code in production or live website.