PurabTech is technical blog for Programmer and Coders
Author: Purab
I am Purab from India, Software development is my profession and teaching is my passion.
Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks.
Purab's Github Repo
Youtube Chanel Video Tutorials
Connect to on LinkedIn
Japan tsunami was shocking news to every body. That’s Why I am also writing about Japan tsunami. That effected to all the world. I can say this unforgettable event of this century.
The first tsunami from the Chile quake hit Japan’s outlying islands on Sunday, but the initial waves were small, though officials warned a bigger surge of water could reach the country’s main islands.
Japan was hit by one of the largest earthquakes ever recorded on March 11. The magnitude-9.0 quake spawned a deadly tsunami that slammed into the nation’s east coast, leaving a huge swath of devastation in its wake. Thousands of people are dead and many more are still missing or injured.
When Friday’s earthquake struck automatic messages were transmitted to television stations across the country.
The on-screen warning messages were followed by a studio announcement.
As the studio shook around him, a news presenter calmly advised viewers to “protect yourselves from falling objects” before reading out the names of areas most at risk.
Japan’s Meteorological Agency said the first tsunami to reach Japan after the magnitude 8.8 quake off Chile was recorded in the Ogasawara islands. It was just 4 inches high. There were no reports of damage.
The government said the tsunami and quake, which was felt as far away as Beijing 2,500 kilometres away, had caused “tremendous damage” while aerial footage showed massive flooding in northern towns.
Seismologists say the quake was 160 times more powerful than the one that devastated Christchurch last month.
Japan tsunami news and photosJapan tsunami news and photosJapan tsunami news and photos
Here is some very horrible photos of japan tsunami.
Japan tsunami news and photosJapan tsunami news and photos
WordPress is very powerful for SEO and blogging. WordPress is very powerful CMS system. You can easily create the e-commerce system using wordpress. In wordpress we are having thousands of free wordpress plugin which is helpful to create the e-commerce, blogging, communication, social networking, video website.
best free wordpress ecommerce plugins
There is many free wordpress ecommerce plugins are available for creating the e-commerce site but we collected very powerful and best free wordpress ecommerce plugins. Here is the list.
The WP e-Commerce shopping cart plugin for WordPress is an elegant easy to use fully featured shopping cart application suitable for selling your products, services, and or fees online.
WP e-Commerce is a Web 2.0 application designed with usability, aesthetics, and presentation in mind.
Include a PrestaShop ecommerce website to your blog. Include the header and footer of your ecommerce website on your blog.
You need to install the PrestaShop module for WordPress on your ecommerce website to use this plugin : http://prestashop.joelgaujard.info/product.php?id_product=17
Some functionalists :
configure the URL of your PrestaShop ecommerce website
creation of 2 widgets to include header and footer
Ecwid is a free full-featured shopping cart and an e-commerce solution that can easily be added to any blog or Facebook profile. It offers the performance and flexibility you need, with none of the hassles you don’t.
“Ecwid” stands for “ecommerce widgets”.
There are eight key advantages to Ecwid:
It’s free.
It has AJAX everywhere and supports drag-and-drop.
It can be easily integrated to any existing site or Facebook profile in minutes.
It can be mirrored on many sites at the same time. Add your store to many sites, manage it from one place.
Integration with social networks. Run your own store on Facebook, mySpace and many others.
Simple to use and maintain. For both store owner and customer.
Lightning fast. New-gen technologies make Ecwid much faster than usual shopping carts regardless the hosting service you use.
Seamless upgrades. You just wake up one day and enjoy new features.
DukaPress is open source software that can be used to build online shops quickly and easily. DukaPress is built on top of WordPress, a world class content management system. DukaPress is built to be both simple and elegant yet powerful and scalable.
Main Features:
You can sell tangible regular products;
You can sell tangible products with selectable options (size, colour, etc);
You can sell digital products;
Choose between a normal shop mode and a catalogue mode;
Numerous payment processing options including Paypal, Alertpay and Mobile Phone payments;
Ability to work with multiple currencies
Printable invoices;
One-page checkout;
Elegant discount coupon management;
A myriad of shipping processing options;
Simple user management and customer order logs;
Custom GUI (Graphical User Interface) for product management;
HTML5 is becoming very popular in the web and internet world, Here in article, we have best fresh and free html5 wordpress themes download which are responsive, HTML 5 is very seo friendly and In HTML5 introduced very nice html tags like aticle, header, footer, nav and many more advanced tags with effects.
best fresh and free html5 wordpress themes download
WordPress theme developer should start working on HTML5 for wordpress theme development. Here we created the fresh and free html5 ready wordpress themes. Which are freely avilable for download.
For professional sites we want to remove category word from wordpress url. here we have short code which can be added in to .htaccess file. that will remove category form url slug.
remove category word from wordpress url
If you want to remove the /category/ word from your URL you need to use the following code.
If you are not wordpress developer and you are not having knowledge of apache server then dont use this code.
first take backup of your .htaccess file which you can find in your root folder of wordpress installation.
WordPress hacks, here in this article we given Best wordpress tips and techniques of all time favorite for all wordpress developers. Code snippets will help you while developing wordpress plugin or theme.
Best wordpress tips and techniques of all time
I collected the best wordpress tricks and tips, Most wanted hacks, Most powerful wordpress techniques and tricks. I included code and there uses in this article. Every wordpress developer are looking for this.
Best wordpress tips and techniques of all time
Robots.txt file
Put valid Robots.txt file so search engine will crawl your site data.
For checking robots.txt file you should use following link
http://tool.motoricerca.info/robots-checker.phtml
Using Pretty Permalinks
Your blog should never have URLs that look like this: www.yourdomain.com/?pageid=21, just like humans, search engine crawlers do not recognize this type of information and is thus useless. Customizing pretty permalinks in WordPress will allow you to use URLs like: www.yourdomain.com/great-post, which are 100% recognizable and will contain keywords for your posts that will make them easier to be found in search engines.
WordPress SEO Plugins
SEO techniques like customizing post titles, description and keywords can be quite a huge task to do when using a bare WordPress theme. The free SEO plugin All In One SEO Pack can make the task 100 times easier and when installed presents options to easily optimize your blog posts and pages.
Random Post
Have you ever been to a site and saw this cool feature? They have a link in their top navigation to something like Stumbe! or Read Random Articles, or some other creative text. When you click on that link, it takes you to a page that displays one random page. Each time you refresh, you are delivered with a new post. Well this trick is just for you then.
You would need to follow the trick #1 in this article to create a custom page template. And simply paste this code in there:
A sitemap helps search engine crawlers to effectively identify pages and posts that should be indexed and made accessible to visitors through search engines. It is basically a file named sitemap.xml which is usually located within your blog’s root directory. The Google XML Sitemaps plugin will help you to easily create and update your sitemap when changes are made to your blog and it also notifies google and bing about the changes. This will significantly increase your site’s crawl rate.
Create a Resourceful 404 Page Design
The above tutorial lists some of the elements that you should have in a 404 page design. Check following designs.
Always ensure that your navigation links are properly structured and placed on your blog. Navigation links need to be relevant to the content they represent, should never be broken or point to pages that have no content. A crowded and poorly structured site navigation gets you nowhere with your readers and search engine crawlers.
Appropriate Tags For Images
Images play an important role in enhancing the look and feel of our blogs and can better capture the attention of our readers more than plain text alone. Images should be used sparingly and when used they need to be of reasonable sizes in terms of (kb) and should have title tags that describe the content they represent. Its very important to use titles that have a strong relation with the supporting post’s content.
Display Feedburner Subscriber Count as Text
Have you ever been to a site that is not using Feedburner button and is still showing subscriber count? Well they are probably using the trick we are about to share. Most designers use this trick to have custom styling and avoid the annoying feedburner button.
Simply copy and paste this code anywhere you like most likely sidebar.php
<?php
//get cool feedburner count
$whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=your feedburner id";
//Initialize the Curl session
$ch = curl_init();
//Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Set the URL
curl_setopt($ch, CURLOPT_URL, $whaturl);
//Execute the fetch
$data = curl_exec($ch);
//Close the connection
curl_close($ch);
$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];
echo $fb;
//end get cool feedburner count
?>
You can wrap it around in styling to make it look like however you want.
Display Twitter follower count
display twitter follower count in your site and attract another user to follow you.
Linking to other related posts within your blog will help to direct search engine crawlers to other pages of your site and also provide an opportunity to enforce what those pages are about. This will also encourage readers to click through to other pages in your blog which is always a good thing. Appropriate link titles should be used to describe what the pages are about.
If you wish to automate this process you can use the SEO Smart Links plugin that will automatically link keywords and phrases in your posts and comments with related posts, pages, categories and tags within your blog.
How to use a Custom Page as a Home Page in WordPress
This is one of the most wanted hacks that users want to know how to accomplish. First you need to learn how to create a custom page. You will need to duplicate your page.php or create a brand new .php file and add the following code at the very top:
Once you have published this page go to Settings » Reading in your admin panel.
And select your page to be the homepage. Now you have yourself a Custom Home Page.
Modify Excerpt Length and More Tags
WordPress lets you display Excerpts, but up until version 2.9 you could not control the excerpt length. With the following code, you can increase the length from default 55 words to as many words as you like. Open your functions.php file and add the following codes in there:
// Changing excerpt length
function new_excerpt_length($length) {
return 100;
}
add_filter('excerpt_length', 'new_excerpt_length');
// Changing excerpt more
function new_excerpt_more($more) {
return '…';
}
add_filter('excerpt_more', 'new_excerpt_more');
Change the 100 word limit to the count that you desire.
Random Redirect
Allows you to create a link to yourblog.example.com/?random which will redirect someone to a random post on your blog, in a StumbleUpon-like fashion.
Display the most Recent Post from a Specific Category
Did you see sites with a magazine style theme who are displaying posts from a specific category. Sometimes only the most recent post. Well you can do this too easily.
Add the above code anywhere you like in the template. Make sure you change the category ID and you can change the number of posts displayed as well if you want.
Display any External RSS Feed in WordPress
Have you seen other bloggers who display their other blog’s feed on their site. You want to do it too for extra promotion and traffic. Well here is the tutorial for you. Simply paste the following code in anywhere in your theme:
<?php include_once(ABSPATH.WPINC.'/feed.php');
$rss = fetch_feed('http://feeds.feedburner.com/wordpressapi');
$maxitems = $rss->get_item_quantity(5);
$rss_items = $rss->get_items(0, $maxitems);
?>
<ul>
<?php if ($maxitems == 0) echo '<li>No items.</li>';
else
// Loop through each feed item and display each item as a hyperlink.
foreach ( $rss_items as $item ) : ?>
<li>
<a href='<?php echo $item->get_permalink(); ?>'
title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
<?php echo $item->get_title(); ?></a>
</li>
<?php endforeach; ?>
</ul>
Highlight Author’s Comment
Have you ever seen this on blogs where author’s comments are distinguished from other comments? Well this is a simple and easy trick.
First you need to open your style.css in your template folder and add the following:
Note you must change 1 to the user id of the author. Once you do this, your blog comments will have a different background for the author’s comment compared to the rest.
Change the Default Gravatar Button
The default mystery man is really annoying for most users. Plus if you have one more chance of branding your blog, then why not do it. Changing your default gr-avatar lets you brand your blog more. With this snippet below you can change your default gravatar.
First you need to open your functions.php which is located in your template folder. If you don’t have one then create one and insert the following code:
In the code the image is being extracted from the theme directory and it is called gravataricon.gif obviously you will change it to your image name. Where it says WordPressAPI, that is the name of the avatar of how it will show in your admin panel options area.
Head over to your admin panel and click Settings > Discussion and change the icon, and now you have a branded comment area with your logo.
Custom CSS Stylesheet for Individual Posts
There are sites that use custom stylesheet for individual posts. Do you want to know how you can do it also? It is very simple. This is accomplished by the use of Custom Fields.
First you will need to open your header.php and insert this code somewhere in between <head></head> codes.
Once you have done that you can add a custom field in each post with the name customstyle and add the css codes in there.
For example if you want the a certain image to have border you can add:
#coolimageclass{border: 5px solid #ccc;}
Use the format above and you now have custom CSS for your single posts.
Display Latest Sticky Posts in WordPress
Assuming that you have already created a custom page template and/or already have The Loop ready, paste the following code before the loop.
<?php
/* Get all sticky posts */
$sticky = get_option( 'sticky_posts' );
/* Sort the stickies with the newest ones at the top */
rsort( $sticky );
/* Get the 5 newest stickies (change 5 for a different number) */
$sticky = array_slice( $sticky, 0, 5 );
/* Query sticky posts */
query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1 ) );
?>
Image Caption
Extracts the title or alt attribute from images within your blog post and generates a neat caption directly underneath those images. Supports custom CSS styling for captions.
Display Most Recent Comments with Gravatars
Have you seen sites that display most recent comments in their sidebar with user gravatars. Well this can be done easily with these codes. Simply paste the following code anywhere you want to display the most recent comments.
Many if not all blogs has some type of social media integration on their site. Most sites though have different social media sites button on their single pages, so they can get more votes.
Delete Posts Revisions from Your Database
Delete Batches of Post Revisions
WordPress has a lot of good features and one of them is Post Revisions. This was included in WordPress 2.6, even though this is a good feature, it can cause some problems. One of them is increase the size of your database. Depending on how long it takes you to write a post, you might have as many as fifty post revisions. Now you can manually delete them, or you can run a simple query which we will show you in this post and get rid of all these useless revisions.
First thing you need to do is login to your phpMyAdmin and select your WordPress Database.
Click on the SQL Button and enter the following query:
DELETE FROM wp_posts WHERE post_type = "revision";
In this code basically we looked up a table wp_posts and removed every post that had a post_type revision associated with it. Now depending on the size of your database, this may save you a lot of space.
you also use the wp-optimize wordpress plugin which is also very nice plugin.
Show Contact form
Many people use the contact us page with wordpress plugin but I will suggest not to use the wordpress plugin for contact form.
One day I faced issue with mysql.sock file. I found Can’t connect to local MySQL error. I solved the issue with following commands.
[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!
Using following command I checked the mysql directory.
[root@localhost ~]# ll /var/lib/mysql/
I did not find the mysql.sock file there.
[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 *
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.
Jquery is most popular and used javascript library which is used for multiple purpose. Every developer is using CSS and Jquery for modifying the UI and usability. Here I collected the more then 100 jquery and CSS techniques and tips and tutorials in this article. This articles are useful for every Jquery developers.
We collected the more then 100 jquery and CSS techniques and tutorials in this article.
Photo Zoom Out Effect with jQueryJquery is most popular and used javascript library which is used for multiple purpose. Every developer is using CSS and Jquery for modifying the UI and usability. Here I collected the more then 100 jquery and CSS techniques and tips and tutorials in this article. This articles are useful for every Jquery developers.
Interactive Photo Desk with jQuery and CSS3
In this little experiment you will create an interactive photo desk that provides some “realistic” interaction possibilities for the user. The idea is to have some photos on a surface that can be dragged and dropped, stacked and deleted, each action resembling the real world act.
By using the jQuery Color plugin, you can animate colors. Simply use the animate() function from jQuery to have colours fade to another colour. When using this technique, combined with some CSS3 features (rounded corners and drop shadow), you can create a Colorful rating system.
Remember jTypingHero? This was a fun little game to test your typing skills based on the ever popular Guitar Hero. By combining CSS3 and jQuery, you will create, in this experimental tutorial, two records that you can start spinning (faster and slower) and even scratching is enabled.
In this quick tutorial, the developer is going to explain how you can have a nicely floated list of items and you will use jQuery to make sure IE understands it too.
In this tutorial you are going to create an awesome image gallery which leverages the latest CSS3 and jQuery techniques. The script will be able to scan a folder of images on your web server and build a complete drag and drop lightbox gallery around it.
CSS3 Glow Tabs
You will learn how to recreate the ‘hover glow tabs’ from the jQuery Conference page, which has a nice “glowing” rollover effect along with a subtle inner shadow at the bottom of the inactive tabs and also applied some rounded corners and gradients to complete a very nice effect.
Recreating the MLB.com Content Switcher
The goal of this project is to try to recreate the Flash content switcher from MLB.com, using jQuery and CSS3 and without any extraneous images or other non-essential elements that tend to make stuff less maintainable.
Pretty Simple Content Slider
You will learn how to create an auto-playing content slider with jQuery and CSS3. The idea is to alter the background image and to slide in the heading and the description. By clicking on one of the menu items, the auto-play function is stopped and the respective content slides out.
In this tutorial you will learn how to recreate a variation of MS Words (2007) toolbar that exposes context-related functionality. When user makes a selection in the input field, a Minibar pops up, semi-transparent, above the selection. It disappears when user clicks anywhere in the input field or performs an action by clicking on a Minibar button.
Making a Sleek Feed Widget With YQL, jQuery & CSS3
In this tut you will larn how to build a sleek feed widget, that will fetch any RSS feed and display it in your blog sidebar. You can set it to show the latest blog posts from different categorie, your latest stumbles, or it even display your Twitter mentions.
Awesome Image Gallery using CSS3 and jQuery
The simple CSS3 image gallery (with jQuery) you will be building will be slightly tilted to the side and on hover will move and whenever you click on the image a lightbox will pop out with the larger version of the image.
Kick-Ass jQuery & CSS3 Gallery With Animated Shine Effects
You will be shown how you can create a kick-ass animated Shine Effect with jQuery & CSS3 and then use it to create your very own Shiny Gallery ‘ShineTime’. This effect is useful in making your user interface elements look like they’re a real polaroid photo (or made of glass) and the best part is, it’s not that difficult to achieve.
A Sexy Vertical Sliding Panel Using jQuery And CSS3
Here you can learn how to make a vertical sliding panel that will act as some sort of drawer instead of the usual top horizontal sliding panel that pushes everything else down when it is open.
Pure CSS3 Bokeh Effect with some jQuery help
IThe bokeh effect is currently a very popular trend amongst designers and in this unique tutorial you will learn how to create a pure CSS3 version of the effect. With some help from jQuery, you can add some randomness the the colors, sizes and vary the positions of the effect.
Create a Nifty Dynamic Shadow with jQuery
Here, Daniel Kurdoghlian, will show you how to recreate the very nifty looking dynamic shadow effect he created for his very popular CSS3 and jQuery experiment. He walks you through every step of the tutorial by using a few teaspoons of jQuery, a pinch of CSS and some transparent PNG’s as Base.
Create A Multiple URL Shortener Page
In this tutorial, you’ll be shown how to create a simple page that will show short urls created by multiple url shortener services. You’ll be using HTML5, CSS3 for styling as well as jQuery for working with Ajax.
In this tutorial you will learn how to build a Simple AJAX Commenting System. It will feature a gravatar integration and demonstrate how to achieve effective communication between jQuery and PHP/MySQL with the help of JSON.
Beautiful Looking Custom Dialog Box With jQuery and CSS3
This dialog box uses CSS3 drop shadow and a completely CSS3 styled button. So, latest version of Chrome, Firefox and Safari will have no problems with it, but for IE6 and 7, the script will work but the display of the dialog box will look plain, no rounded border, drop shadow and gradient.
Making a Mosaic Slideshow With jQuery & CSS
When designing a product page, it is often necessary to present a number of images in a succession, also known as a slideshow. In this technique you will be making a jQuery & CSS mosaic gallery, featuring an interesting tile transition effect when moving from one slide to another.
Beautiful Photo Stack Gallery with jQuery and CSS3
In this tutorial you are going to create a nice and fresh image gallery. The idea is to show the albums as a slider, and when an album is chosen, you show the images of that album as a beautiful photo stack. In the photo stack view, you can browse through the images by putting the top most image behind all the stack with a slick animation.
Interactive Image Vamp up with jQuery, CSS3 and PHP
In this technique you will be shown how to create an online application for giving some funny touches to an image, using jQuery and jQuery UI for dragging and resizing little bling elements like mustaches and glasses. With PHP the image and the bling elements will get merged and the end result can be viewed.
CSS3 & jQuery Image Effects Image Highlighting and Preview with jQuery
In this tutorial you will be shown how to highlight and preview images that are integrated in an article or spread over a page. This is a nice way to allow users to view a bigger version of an image that is relevant to some context.
CSS3 Rounded Image With jQuery
In this tutorial you will learn how to give an image rounded corners using the CSS3 border-radius and box-shadow properties and using jQuery to automatically wrap a span tag around the image.
CSS3 & jQuery Menu and Navigation Tutorials Contextual Slideout Tips With jQuery & CSS3
With this tut you will learn how to make a set of contextual slideout tips with jQuery & CSS3, which are ideal for product pages and online tours. As a bonus, they are SEO friendly, so all the content is visible to search engines.
Elegant Accordion with jQuery and CSS3
Here you will create an elegant accordion for your sites content. The idea is to have some vertical accordion tabs that slide out when hovering. You will add some CSS3 properties to enhance the looks.
In this tutorial you will create a unique bottom slide out menu. This large menu will contain the title and a description of the menu item and it will slide out from the bottom revealing the description text and icons. You will use some CSS3 properties for some nice shadow effects and jQuery for the interaction.
Sweet AJAX Tabs
Organizing the content of a page in a both intuitive and eye-catching manner, is a must in modern web design. One principle that has been around for some time is dividing text into tabs. In this tutorial you will be making an AJAX-powered tab page with CSS3 and version 1.4 of jQuery
Mac-style Skype Application Menu
Using CSS3 and jQuery for extra functionality you will learn how to recreate the amazing slick Skype (for Mac) layout. (Not the full layout: Only the menu where all your friends are listed).
Halftone Navigation Menu
In this tut you will be making a CSS3 & jQuery halftone-style navigation menu, which will allow you to display animated halftone-style shapes in accordance with the navigation links, and will provide a simple editor for creating additional shapes as well.
Create Accordion Menu Using CSS3 Transitions
There are many ways to create an accordion menu, most of them use a javascript library like jQuery to make the effect runs cross browsers. In this tutorial, you’ll see how to make an accordion
From 3rd version wordpress introduced links template. Links is same important like archive page. code snippet for create links template page in wordpress.
create links template page in wordpress
Links template page concept is new in wordpress theme. From wordpress 3 version wordpress introduced the links.php template file in wordpress themes. Adding the links page to your wordpress site or blog is very good for seo.Links page is same important like archive page.
create links template page in wordpress
You can add your friends and good websites in links page. You should use the links page very carefully because this page is very important for SEO. Google and other search engine is always look for links page where you can put other network or friends sites.
How to create links template page
Note: If you are wordpress developer then only use following code.
You need to create the links.php file in your wordpress theme folder. and put following code in that file.
If you link this article then please add my site in your links page or blogroll. If you are having any issues or question about links template then please write to me on support@purabtech.in.
WordPress tutorial, wordpress add tags to custom post type. we can create the custom post type. In this tutorial I will show you to add category and tags.
wordpress add tags to custom post type
wordpress add tags to custom post type
You just need use the following code in your arguments.
'taxonomies' => array('category', 'post_tag') // this is IMPORTANT
Here is full code which is I used in functions.php file
In wordpress we can create the custom post types. Now everybody is using custom post types in wordpress and need comments functionality for custom post types also. Custom post types are very important feature of wordpress. For enabling the comments for custom post type just use the following line.