4 Things to Do If WordPress Plugins Broken Your WordPress Blog

What will you do if wordpress plugin broken your wordpress blog? I believe that most people have experienced this problem before, and how you overcome your problem? I remember when my wordpress blog was unable displayed properly after installed particular wordpress plugin, so I deleted all the wordpress files, wordpress themes, wordpress plugins, and then I upload all the files again. Anyway, it is work fine finally.

If you can’t display your wordpress blog after installed particular wordpress plugin, you can follow the below steps to solve this problem.

1. De-active the Plugin
Try to de-active the wordpress plugin that you have installed just now.

2. Rename the Plugin via FTP
If it is crash by admin area and caused you can’t de-active the plugins, then you can rename the plugins via FTP.

3. Delete the Plugin via FTP
If simply renaming the plugin was not enough, try to delete it completely.

4. De-activate all the plugins via PHPMyAdmin
Some plugins will alter tables in your WordPress database when you activate them. As a result your blog might keep crashing even after you delete the plugins via FTP.

If that is the case, you will need to log into cPanel, and open the PHPMyAdmin interface. Then select the WordPress database, and browse inside the “wp-options” table. Look for the “active_plugins” column, and edit it. Inside the “options_value” field you will find something like this:

a:31:{i:0;s:13:"AddMySite.php";i:1;s:19:"akismet/akismet.php";
i:2;s:23:"all_in_one_seo_pack.php";i:3;s:16:"authenticate.php";
i:4;s:28:"breadcrumb-navigation-xt.php";i:5;s:18:
"codeautoescape.php";i:6;s:37:

These lines represent the active plugins in your blog. Delete them all and save. This should automatically de-activate every plugin. Now check if your blog is live again, and if the admin area is working. They should be.

/// Source

How to Display Most Recent Twitter Tweets in WordPress Blog

Since Twitter became popular, many bloggers like to display recent twitter tweets on their website or blog. To display most recent twitter tweets, simply copy and paste the following code to your sidebar.php file.

<?php
// Your twitter username.
$username = "TwitterUsername";
// Prefix - some text you want displayed before your latest tweet.
// (HTML is OK, but be sure to escape quotes with backslashes: for example href=\"link.html\")
$prefix = "";
// Suffix - some text you want display after your latest tweet. (Same rules as the prefix.)
$suffix = "";
$feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1";
function parse_feed($feed) {
$stepOne = explode("<content type=\"html\">", $feed);
$stepTwo = explode("</content>", $stepOne[1]);
$tweet = $stepTwo[0];
$tweet = str_replace(”&lt;”, “<”, $tweet);
$tweet = str_replace(”&gt;”, “>”, $tweet);
return $tweet;
}
$twitterFeed = file_get_contents($feed);
echo stripslashes($prefix) . parse_feed($twitterFeed) . stripslashes($suffix);
?>

Thanks the awesome code from WP Hacks.

How to Backup and Restore WordPress Database

Please keep in mind that you need to backup your wordpress database periodically to prevent your data lose in case of bad plugin installation or an attack by hacker. So do you know how to backup and restore your wordpress database? If you don’t, let me show you how.

DISCLAIMER: I will not going to hold responsible in any way should you encounter problems like loss of database and entire blog/website along the way. It worked excellently well for me.

How to Backup Your WordPress Database

1. Download and install WordPress Database Plugin and active this plugin.

2. In your wordpress dashboard, go to Tools > Backup

3. Under Backup Options, select “Download to your computer” and click on “Backup Now” button.

How to Restore Your WordPress Database

1. Log into your FTP account and delete everything in the /wp-content/cache directory.

2. Log into PHP MyAdmin and select your wordpress database.

3. A list of all of the tables contained in the database will be shown. Select all the tables and select the Drop option to delete them permanently.

4. After wordpress database is empty, it is time to upload your database by clicking Import tab.

5. Locate of the text file and then click “Go” button to import your wordpress database.

How to Create Meta Description Function and Meta Keyword Tags

If you want to create meta description function and meta keyword tags for your wordpress themes, open header.php file and then copy and paste the following code within <head> and </head>.

<meta name="description" content="
<?php if ( (is_home()) || (is_front_page()) ) {
echo ('Your main description goes here');
} elseif(is_category()) {
echo category_description();
} elseif(is_tag()) {
echo '-tag archive page for this blog' . single_tag_title();
} elseif(is_month()) {
echo 'archive page for this blog' . the_time('F, Y');
} else {
echo get_post_meta($post->ID, "Metadescription", true);
}?>">

Thanks the original function from Malcolm Coles.

How to Display the Total Number of Comments on Your Blog

Who don’t like to have comments on your blog? If your blog has many comments, it can be say that your blogs is popular, at least people like to interact with you to ask question and share information with you. If you really proud with your total number of comments on your blog, and want to show off to visitors.

To display the total number of comments on your blog, simple add the following code to your wordpress files.

<?php
$numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
if (0 < $numcomms) $numcomms = number_format($numcomms);
echo "There's ".$numcomms." total comments on my blog";
?>

Special thanks to PHP Magic Book for this awesome code.

How to Create Page Templates

Normally I will use page templates to display the archives which will list all posts on my blog, anyway you can use page templates to get specialized results apart from the basic static page template.

What you need to do is to add the following code to the first line of your php files, you can change the template name as you wish.

<?php
/*
Template Name: Archives
*/
?>

So now, you have to create a page template named Archives. Then, create a new page, find Template drop down box (refer picture) and choose Archives, this is a page template named Archives that you have created just now.