alexa verification for wordpress websites

Alexa is website ranking service website which will give you the ranking of website. We have wordpress plugin for alexa verification for wordpress websites. But there is an issue with this site. This site is collecting data from all over the world. Means your site is popular in some country then your site will never come in top for all the world.

alexa verification for wordpress websites

For coming the in Alexa rank you need to register the your website with Alexa. You should verify your website with Alexa code.

For Alexa verification of website follow my steps:

1. Open or visit the Alexa website
2. Then click menu Edit Site.  Then we wil be brought to user login page from Alexa,  if you do not have account then please register first.
3. Next, see your email and open your member confirmation email from alexa.
4. After confirmation, re-click menu Edit site. Enter your website’s or your blog’s data into here.
5. Then, do your blog verification.
This verification can be done in three ways, just choose one:

First, by using Meta Tag. Copy paste this meta tag between tag with in your blog template.Second, by upload into your blog’s root. Make a file format .txt using notepad, copy paste meta tag into that file and make the name as instruction from alexa. Then upload the file into your blog’s root into the hosting that you used.

Third, by confirming via email.

* After you choose and use one of the verifications above, then click verification button.

alexa verification for wordpress websites
alexa verification for wordpress websites

For Alexa Ranking there is very nice wordpress plugin. You should use this alexa wordpress plugin in your website for best ranking.

You can download this plugin from following URL:

Alexa Rank Widget

https://wordpress.org/plugins/alexa-rank-widget/

Using this wordpress plugin your blog ranking will increase.

adding custom styles to search widget in wordpress

Many people having issue when creating the wordpres theme and show search widget in theme. wordpress tutorial, adding custom styles to search widget in wordpress. In this tutorial we will show you how to show search widget with our custom styling.

adding custom styles to search widget in wordpress

you can override the default wordpress search widget.

adding custom styles to search widget in wordpress
adding custom styles to search widget in wordpress

For that use the following code.


function widget_override_search(){
?>
<ul>
	<li id="linkcat-2">
<h2> WordPress Search</h2>
<form id="searchform" style="padding: 10px;" action="<?php bloginfo('home'); ?>" method="get">
<div>
<input id="s" name="s" size="50" type="text" />
<input id="searchsubmit" type="submit" value="<?php echo attribute_escape(__('Search')); ?>" />
</div>

</form>
</li>
</ul>


<!--?php
}
if ( function_exists('register_sidebar_widget') )
 register_sidebar_widget(__('Search'), 'widget_override_search');

–>

Solved issue: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock

[root@localhost ~]# mysqladmin -u root shutdown
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)’
Check that mysqld is running and that the socket: ‘/var/lib/mysql/mysql.sock’ exists!

Solved issue: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock

Using following command I checked the mysql directory.
[root@localhost ~]# ll /var/lib/mysql/

I did not found the mysql.sock file there.

[viral-lock message=”Solution is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]

[root@localhost ~]# cd /var/lib/mysql/
Created file in that location.
[root@localhost mysql]# touch mysql.sock
Gave the executabe permission the sock file.
[root@localhost mysql]# chmod +x mysql.sock
Changed the permission to mysql user
[root@localhost mysql]# chown mysql:mysql -R *

[/viral-lock]

After that restarted the machine
[root@localhost mysql]# /etc/init.d/mysqld start
Starting mysqld:                                           [  OK  ]
[root@localhost mysql]# mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.52 MySQL Community Server (GPL) by Remi

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> show databases;

Can't connect to local MySQL server through socket
Can’t connect to local MySQL server through socket

how to add jquery in wordpress plugin

All web developers know about jquery. May be all of us know or heard about jquery. Jquery is javascript open source library. WordPress itself uses the jquery library for long time but many developers does not know about that.
Because When we develop new wordpress themes then we include the jquery files in that theme.

jquery tips for wordpress theme developers

jquery tips for wordpress theme developers
jquery tips for wordpress theme developers

In this tutorial I will give very simple and basic tips about using jquery in wordpress themes. Using jquery we will introduce very nice effect in our website. with jquery we can generate the more traffic to our website.

Jquery is very lightweight javascript framework. Many web developers developed developed the third party effects and code with jquery.
We can add the Jquery in wordpress theme with very minimal effect. wordpress is given the api for including the jquery in our wordpress theme.

Add Jquery in wordpress theme

For adding the jquery in wordpress you just need to use header.php or functions.php file and put following code in that file.
For header.php put following code in that file.

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php wp_enqueue_script(‘jquery’); ?>

If you want to use the functions.php file for adding the jquery then use following code.

function insert_jquery()
{
wp_enqueue_script(‘jquery’);
}
add_filter(‘wp_head’,'insert_jquery’);

Above are the very simple and basic tips for adding the jquery in your wordpress theme.

This code will include the latest jquery file in your wordpress theme.

domain search through Linux command and PHP

tutorial for PHP, domain search through Linux command and PHP. Searching the domain information through command line. You can search the domain using the Linux command.

domain search through Linux command and PHP

#whois google.com

using the following command you can find the all domain information.

If you want check when domain created then use following command.

#whois google.com | grep “Created | Creation”

If you want to create PHP script for domain search then use following code


$domain_info = exec("whois google.com | grep 'Created |Creation'");

if($domain_info =''){

echo "Domain is not yet registered";

} else {

echo $domain_info = exec("whois google.com");

}

Above script will only work in Linux server.

deleting all one day old files from folder through php

If you want to find the old files from your system or server then you can use the following code. I used the following code for deleting the old files from system.

deleting all one day old files from folder through php


/*****************Get the path to Extension ****************/
$array_path = explode("/",$_SERVER['SCRIPT_FILENAME']);
<div id=":2e">$dynamic_path = "";
for ($i=0;$i
 if($array_path[$i]!="")
$dynamic_path =$dynamic_path."/".$array_path[$i];

// This linux command will delete the one day older from specific folder.
exec("find ".$dynamic_path."* -mtime +1 -exec rm {} \;");</pre>
<div>
For deleting the old files from system I used the Linux command. You can execute the command using the exec function.
If you want to use the Linux command then use the following command
# find /home/user/test/ -m

deleting all one day old files from folder through php
deleting all one day old files from folder through php

time +1 exec rm {}

Above code will only work in Linux server.

Display FeedBurner Reader count in wordpress blog

Displaying the feed burner reader count is nice idea for bloggers. This way can show your blog readers to other blog viewers.
For seo purpose displaying the feed burner reader count is very nice.

Display FeedBurner Reader count in wordpress blog

You can your following code in your wordpress theme file.

<?php
$url = file_get_contents('https://feedburner.google.com/api/awareness/1.0/Get
FeedData?uri=YOUR FEED ADDRESS');
$begin = 'circulation="'; $end = '"';
$page = $url;
$parts = explode($begin,$page);
$page = $parts[1];
$parts = explode($end,$page);
$fbcount = $parts[0];
if($fbcount == '') { $fbcount = '0'; }
echo '
<div> '.$fbcount.'  Subscribers</div>';
?>
Display FeedBurner Reader count in wordpress blog
Display FeedBurner Reader count in wordpress blog

How to create wordpress widget plugin

How to create wordpress widget plugin, In this article, given full code and with explanation.  For creating wordpress widget you just need use our code. In many wordpress themes we want to create the wordpress widget. For creating the wordpress widget you just need to put following code in functions.php file.

How to create wordpress widget plugin

This functions.php file you can find in wordpress theme folder.

class My_Widget extends WP_Widget {
function My_Widget() {
parent::WP_Widget(false, 'Our Test Widget');
}
function form($instance) {
// outputs the options form on admin
}
function update($new_instance, $old_instance) {
// processes widget options to be saved
return $new_instance;
}
function widget($args, $instance) {
// outputs the content of the widget
}
}
register_widget('My_Widget');

this code

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
class bm_widget_popularPosts extends WP_Widget {

function bm_widget_popularPosts() {
parent::WP_Widget(false, 'Popular Posts');
}

function widget($args, $instance) {
$args['title'] = $instance['title'];
bm_popularPosts($args);
}

function update($new_instance, $old_instance) {
return $new_instance;
}

function form($instance) {
$title = esc_attr($instance['title']);
?></pre>
php echo $this->get_field_id('title'); ?>"><!--?php _e('Title:'); ?--> <input id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
<pre>
<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
}
}
function bm_popularPosts($args = array(), $displayComments = TRUE, $interval = '') {

global $wpdb;

$postCount = 5;

$request = 'SELECT *
FROM ' . $wpdb->posts . '
WHERE ';

if ($interval != '') {
$request .= 'post_date>DATE_SUB(NOW(), ' . $interval . ') ';
}

$request .= 'post_status="publish"
AND comment_count > 0
ORDER BY comment_count DESC LIMIT 0, ' . $postCount;

$posts = $wpdb->get_results($request);

if (count($posts) >= 1) {

if (!isset($args['title']) {
$args['title'] = 'Popular Posts';
}

foreach ($posts as $post) {
wp_cache_add($post->ID, $post, 'posts');
$popularPosts[] = array(
'title' => stripslashes($post->post_title),
'url' => get_permalink($post->ID),
'comment_count' => $post->comment_count,
);
}

echo $args['before_widget'] . $args['before_title'] . $args['title'] . $args['after_title'];
?>

<ol>
<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
foreach ($popularPosts as $post) {
?>
<li>
php echo $post['url'];?>"><!--?php echo $post['title']; ?-->
<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
if ($displayComments) {
?>
(<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php echo $post['comment_count'] . ' ' . __('comments', BM_THEMENAME); ?>)
<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
}
?>
</li>
<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
}
?>
</ol>

<?php
echo $args['after_widget'];
}
}
?>

 

How to create wordpress widget plugin
How to create wordpress widget plugin

how to convert video to flv using php

Tutorial for how to convert video to flv using php. Most of video upload sites are using the ffmpeg and php for uploading and converting the video files.  For converting you need to install the ffmpeg on your server. you can download and install ffmpeg from following location.

how to convert video to flv using php

how to convert video to flv using php
how to convert video to flv using php

http://www.ffmpeg.org/download.html

For installting the ffmpeg on linux box I found following article very helpful

http://mysql-apache-php.com/ffmpeg-install.htm

After installing the ffmpeg on your system you can use following commands for converting the video files to flv format.

avi to flv convert through ffmpeg

ffmpeg -i 00138.avi  -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv final.flv

For creating the thumbnail the from video file you can use the folowing command.

create thubnail from movie file
ffmpeg -y -i moviefile.avi -vframes 1 -ss 00:01:60 -an -vcodec png -f rawvideo -s 110×90 new.png

In PHP you can use the following code easily.


$video_file = '/pathtovideo/test.avi';

$flvfile ='/pathtoflv/test.flv';

$png_path ='/pathtopng/test.png';

exec("ffmpeg -i ".$video_file."  -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv ".$flvfile.");

//for thumbnail

exec("ffmpeg -y -i ".$video_file." -vframes 1 -ss 00:01:60 -an -vcodec png -f rawvideo -s 110x90 ".$png_path.");

Above code with convert the video file to flv format but my suggestion is convertion of video files will take so much bandwidth on server so use cronjob for converting the video files in night time.

increase upload file size limit in wordpress

Many people want to upload big size media in wordpress. Now with current version you can upload 10 mb file in wordpress.
If you want to increase upload file size limit in wordpress then you should make some changes in your wordpress code. We briefly explained same in article.

increase upload file size limit in wordpress

First option you need to open your functions.php file and put following code in that file.
Note: Here with this code you can upload the upto 50 mb file to your wordpress website.

ini_set('upload_max_size','50M');
ini_set('post_max_size','50M');
ini_set('max_execution_time,'300');

Open your wp-settings.php file which you can find in your root directory. Put following code in that file.

if ( !defined('WP_MEMORY_LIMIT') )
 define('WP_MEMORY_LIMIT', '500M');

Add this code following code in your .htaccess file. This file you can find in your root directory.

php_value upload_max_filesize 50M
php_value post_max_size 50M
php_value max_execution_time 300
php_value max_input_time 300
increase upload file size limit in wordpress
increase upload file size limit in wordpress

Above method is used by many web developers for increasing the file upload limit on server for PHP language.