Jun 29, 2011

Warning: Missing required field "entry-title" | Missing required field "updated". | Missing required hCard "author".

Warning: Missing required field "entry-title" | Missing required field "updated". | Missing required hCard "author".
Warning: Missing required field "entry-title".
Warning: Missing required field "updated".
Warning: Missing required hCard "author".

Are you facing these errors while checking your rich snippets microformat?

Just add these following codes to your respective file and lines:-
For entry title:

[php]<h1 class="entry-title"><?php the_title();  ?></h1>[/php]
For update:
[php]<h2 class="updated"><?php the_date();?></h2>[/php]

For hcard author:
[php]Author:<p class="author"><span><?php the_author(); ?></span></p>[/php]

The above solution is for wordpress, for custom sites, just replace the code with your own code, like the_title will be replace with your page title etc.

Done, now you will see no warnings in testing your webpage on rich snippets testing tool

Wordpress-Publish new post redirecting to homepage | While saving edited code redirecting to home-page

Wordpress-Publish new post redirecting to homepage | While saving edited code redirecting to home-page

This is an hectic bug for us, whenever a user tries to publish the post or save any code changes, it redirects to the homepage without publishing and saving the code,

This problem I also faced, many people recommends of redirection plugin fixes, but in many cases people are not using that, and then also they facing this kinds of problems.

The only solution to this is writing a simple code in .htaccess file

[php]<IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule>[/php]


Just copy paste the above code and then done, you are free to publish post and save the codes without any home-page redirection.
This usually happens when on server, some changes are made on mod_security rule.So next time if you face this problem, no worries, just follow this post

Wodpress plugins not updating | Plugins Incompatible Archive Plugin upgrade failed | wordpress themes not updating

As the title describes the post, If you face any of these problems, where if you try to update your wordpress plugin or wordpress themes and you get the following error
Unpacking the update…

Installing the latest version…

Incompatible Archive.

Plugin upgrade failed

Then first thing you should do is, check whether your wordpres is updated, if not then manually update it, this is very easy to do, you get the exact way to update wordpress manually here


After this also, if updating of plugins doesn't works then just replace class-ftp-sockets.php file with the following file


This will work for sure,

Happy coding :)


Jun 28, 2011

Wordpress showing blank white page | White screen of death

What! My wordpress Site Showing White Blank Page! No Errors !
Are you having this kind of problem ????
Don't panic, this is Wordpress White Screen Of Death
The name looks dangerous, but it is not,
Many times, mostly when transferring wordpress site from one hosting to another, people find that when running their website, they find wordpress is displaying White Blank Screen
This is caused because of damaged files in Wordpress.
The following are the solutions for it:-
<li>Reinstall Wordpress</li>
<li>Check wp-config file</li>
<li>Deactivate All plugins</li>
<li>Change the theme to default</li>

  • Reinstall the wordpress, just go to your file manager through FTP or cpanel and reinstall the wordpress manually by copy pasting files.(Before trying this try other steps)
    Remember Dont copy Wp-Content Folder.

  • WP-CONFIG.PHP check your wp-config file, it should start with[php]<?php[/php]

    and end with[php]?>[/php]

    their should be no space or blank line before and after it.

  • DEACTIVATE PLUGINS AND THEMES, just through your file manager, rename the folder of your plugin and themes to any other name in my case i used Plugins_temp and Themes_temp
    this deactivated all the plugins, and it made my theme to default Twenty-ten theme

Thats it you are done, these answer's will solve your problem,
Any problem persists, feel free to ask
Sharing is Caring

Wordpress-Add custom taxonomies tags to permalinks

Hello everyone, today we are going to discuss with you how to add wordpress custom taxonomies to permalinks.
You can refer custom taxonomies or taxonomies from here

Ok first of all, you need to register custom taxonomy with setting "rewrite=true", doing this will enable %custom_taxonomy_tag%
If you want to add custom taxonomies without coding, i prefer this plugin GD CPT tools

After doing all these things, you need to copy paste this function, to your theme's function.php file
[php]add_filter('post_link', 'taxo_permalink', 10, 3);
add_filter('post_type_link', 'taxo_permalink', 10, 3);

function taxo_permalink($permalink, $post_id, $leavename) {
if (strpos($permalink, '%taxo%') === FALSE) return $permalink;

//To Get post
$post = get_post($post_id);
if (!$post) return $permalink;

//To Get taxonomy terms
$terms = wp_get_object_terms($post->ID, 'taxo');
if (!is_wp_error($terms) &amp;&amp; !empty($terms) &amp;&amp; is_object($terms[0])) $taxonomy_slug = $terms[0]->slug;
else $taxonomy_slug = 'no-taxo';

return str_replace('%taxo%', $taxonomy_slug, $permalink);
Line 5 – If the permalink does not contain the %taxo% tag, then we don’t need to translate anything.
Line 12 – Get the taxo terms related to the current post object.
Line 13 – Retrieve the slug value of the first taxo custom taxonomy object linked to the current post.
Line 14 – If no taxo terms are retrieved, then replace our taxo tag with the value no-taxo.
Line 16 – Replace the %taxo% tag with our custom taxonomy slug.

Now in wordpress, dashboard-settings-permalinks, you can write
This way you can add more custom taxonomies, just by adding more functions.
So Simple!!!!!!!

Configuring VPS | Moving wordpress from old hosting to new VPS | Part 2

Part 2:
As now, you have configured VPS, Now its time to move your old wordpress site to our new VPS(Which is already configured with LAMP). If you have not configured till yet, then it is my suggestion that you go back to my first tutorial
Configure VPS | Install LAMP on Centos VPS Part 1

So now lets begin the tutorial
As now, you know the basics on how to handle putty software and the ssh commands,
So lets start

First we will create the backup of the folder in your old server/hosting,
This is can be much easier through Cpanel, but if you don't have, then you have to enable the ssh by asking your hosting people.
Then connect to your old servers ssh and follow these steps

[php]cd public_html/your_directory_of _your_website_folder
tar -cvf foldername.tarcd /var/www/html
wget http://nirajmchauhan.blogspot/wordpress.tar
tar -xvf wordpress.tarcd /var/www/html
wget http://webstutorial.com/mysql.tar
tar -xvf mysql.tarmysql -u user -p dbname &lt; {path}/backup.sql[/php]

Remember your_directory_of _your_website_folder should be your wordpress folder and foldername.tar foldername will be the wordpress folder name, and your backup will be created in the name of that folder.

Now exit and connect to your new VPS, and follow these commands

[php]cd /var/www/html
wget http://nirajmchauhan.blogspot/wordpress.tar
tar -xvf wordpress.tar[/php]

In the first line we are giving the command to change the directory.
Second line, is used to download the compressed backup file from your old server.
REMEMBER:The URL and the back-up-file-name should be perfect, don't directly copy-paste mine
Third line is used to extract the backup

Till now we were successful to bring the wordpress to our new VPS, now we will bring the database of the wordpress.

The very first thing is to create the back-up of the wordpress mysql database, by logging into your old servers phpmyadmin, selecting the appropriate database and exporting that.
For this I ll suggest you to follow this link,
Backing up database

Now if you are ready with the mysql database backup, its time to bring it on our new VPS.

[php]cd /var/www/html
wget http:nirajmchauhan.blogspot.com/mysql.tar
tar -xvf mysql.tar[/php]

after extraction of database backup we will integrate it with phpmyadmin.
Before doing this, you have log in to new VPS php-my-admin window and create a new database, lets consider it as niraj

Sample of the code:

[php]mysql -u user -p dbname &lt; {path}/backup.sql[/php]
Actual Code:

[php]mysql -u root -p niraj &lt; /var/www/html/backup/niraj.sql[/php]
Just assuming my username to be root, my roots password to be password, niraj to be my new database in php-my-admin, which we created, and niraj.sql is the database sql file which we extracted before few steps.

You have successfully installed your old site to new VPS,
just after this you need to configure your wordpress wp-config file and add user to your php-my-admin for your database.
If any questions, feel free to ask

Happy coding

Configure VPS | Install LAMP on Centos VPS Part 1

Few days before when I had a VPS and needed to install wordpress, I found it very difficult because very few resources were available on google
So I am here now with my new post, On HOW TO INSTALL LAMP ON CENTOS
First buy an unmanaged VPS, and get ssh access
Then install Putty software in your computer, and start it
Then Follow the further steps
Start Putty software and then enter your IP for eg.
it will ask for username
generally its root and then enter the password
after that start typing the following code
First we will install yum

yum install -y yum-priorities


After this we need to download updated repositories for php and mysql

wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm


Then we will extract that by following command


rpm -Uvh epel-release-5-4.noarch.rpm

rpm -Uvh remi-release-5.rpm


After This we give priorities to repo and exclude php mysql and phpmyadmin from repository


vi /etc/yum.repos.d/CentOS-Base.repo

After this a file will be opened, press I from the keyboard to edit it, and after editing press esc button and type :x to save it


exclude=*php* *mysql* *phpmyadmin*


Copy paste this above code five times before the following lines

#released updates
#packages used/produced in the build but not released
#additional packages that may be useful
#additional packages that extend functionality of existing packages
Copy paste the next lines before this line #contrib - packages by Centos Users


exclude=*php* *mysql* *phpmyadmin*


Just one line above priority=2 their will be a line enabled=0 just make that to 1
After this press esc and type :x to save the file
Now same thing for epel and remi repository


vi /etc/yum.repos.d/epel.repo

Just Above this line [epel-debuginfo] insert this code(inserting and saving is been explained on top)




Now after saving that, we will now edit the same code with just different filename


vi /etc/yum.repos.d/remi.repo


And now in this, just above [remi-test] line, change the value of enable=0 to 1
and paste this code exactly above the [remi-test] line




Save it and now we will install apache web server,

yum install -y httpd


After this we will install php,


yum install php


During the installation it will prompt you for importing GPG key for the new repositories, just type y and press enter, this will be come for two times
Now we will start the Apache server


/etc/init.d/httpd start


Just to test our Apache and php, we will create a phpinfo file


vi /var/www/html/info.php


A new file will be created, insert this code into it, and then save it




Now in your browser, enter this URL, http://your IP or localhost/info.php
Now a PHP INFO file should open, where it will display php and servers information
if not then restart the apache server,
To restart the server,


/etc/init.d/httpd restart


Now we will install MySql


yum install -y mysql-server mysql php-mysql


Now the next code is used to configure Apache , to start MySql when server is rebooted.

chkconfig httpd on
chkconfig mysqld on


Fire up MySql Server


/etc/init.d/mysqld start


Now we will set the root password of mysql



mysql -u root password password

Here the second password is the actual root password, you can change it with your's own.

Now its time to do last job, thats installing phpmyadmin


yum install -y phpmyadmin

Now we have to edit phpMyAdmin config file to avoid the Forbidden Access Error


vi /etc/httpd/conf.d/phpMyAdmin.conf


Search for a line,


deny from all# deny from all


Comment the above line just by inserting # before the line, so after that, it should look like the following,

# deny from all

Save it and restart the Apache server



/etc/init.d/httpd restart


Now goto the browser and type this URL
http://IP or localhost/phpmyadmin
Now the page will appear, just enter username as root and password as password

Check my next post, Part-2, on how to transfer a wordpress site from existing hosting to your newly configured VPS
Feel free to give suggestions.