How to automatic login in wordpress.

//if "" is already registered



wp_set_current_user($pl_userid, $user_email);

// set the WP login cookie
$secure_cookie = is_ssl() ? true : false;
wp_set_auth_cookie( $pl_userid, true, $secure_cookie );

do_action('wp_login', $user_email);


Get All Urls in Magento

Not secure Skin URL
<?php echo $this->getSkinUrl(‘images/sampleimage.jpg’) ?>

Secure Skin URL
<?php echo $this->getSkinUrl(‘images/ sampleimage.gif’,array(‘_secure’=>true)) ?>

Get  Current URL
<?php $current_url = Mage::helper(‘core/url’)->getCurrentUrl();?>

Get Home URL
<?php $home_url = Mage::helper(‘core/url’)->getHomeUrl();?>

Get Magento Media Url
<?php Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);?>

<?php Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);?>

Get Magento Skin Url
<?php Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>

Get Magento Store Url
<?php Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>

WordPress Contact Form 7 Redirect To Thank You Page

How To Redirect Visitors To A “Thank You” Page In Contact 7 for WordPress:

Go To WordPress dashboard and go to Contact Form 7 plugin settings page (click contact in your dashboard).  Find ‘Additional Settings’ at bottom of your form page and insert the following code:

on_sent_ok: "location.replace('');"

Save form

Now visitors will be successfully redirected to your custom thank you page when they fill in your WordPress Contact 7 form.


1. Login to your WordPress account and navigate to the Dashboard for the blog that you’d like to transfer to Blogger. Click on the Tools tab > Export link, then download the WordPress WXR export file by clicking on Download Export File and save this file to your local machine.

2. Go to WordPress2Blogger, browse to that saved document and click Convert and save that file to your local machine. In this file will be the contents of your posts/comments from WordPress in a Blogger export file.

3. Then from your dashboard: Settings > Basic tab and click “Import” to import the converted file.

How to fetch posts from custom posts type with custom taxonomy

suppose custom taxonomy name is "dp-cat".
custom category name is "Industrial".
and custom post type "design-port".



$args = array('post_type' => 'design-port', 'dp-cat' => $current_tab_cat);

$loop = new WP_Query( $args );

global $post; while ( $loop->have_posts() ) : $loop->the_post();





Import a CSV File Using PHP and MySQL

 <?//get the csv file
$file = $_FILES[csv][tmp_name];
$handle = fopen($file,”r”);

//loop through the csv file and insert into database
do {

if ($data[0]) {
mysql_query(“INSERT INTO contacts_tmp (contact_first, contact_last, contact_email) VALUES

} while ($data = fgetcsv($handle,1000,”,”,”‘”));


Choose your file: