Month: February 2016

Create password protected directory using htaccess on server

Add security using password protected directory  on server as like admin site first ask to permission to go admin area. Add authentication on WordPress administration. Password protect our wordPress admin (wp-admin) directory. Bellow example for WordPress wp-admin password protected.

Step : 1

Login to your cpanel and go to “Password Protect Directories”.  After select directory OR add directory as your cpanel options. in my cpanel select directory in bellow screen short.


Step : 2

Add protected directory name, username, password.


Step : 3

Go to file manager and your selected directory create .htaccess file  with this script.

ErrorDocument 401 "Denied"
ErrorDocument 403 "Denied"

<Files admin-ajax.php>
Order allow,deny
Allow from all
Satisfy any

Import database mysql wamp server using command line

Import database mysql wamp server using command line

Some time we have Big database to import problem in to using command line solved problem as like simple like this.

(mysql.exe full path) -u (user name) -p (password) (database name) < (import database file full path)

d:\wamp\bin\mysql\mysql5.6.12\bin\mysql.exe -u root -p mydbname < d:\mydb.sql

Display RSS Feed using WordPress

Using WordPress we can add RSS feed easily for default WordPress function. Using bellow snippet list of RSS feed.

/* Display RSS Feed using WordPress

include_once(ABSPATH.WPINC.'/rss.php'); // path to include script
$feed = fetch_rss('feed url'); // specify feed url
$items = array_slice($feed->items, 0, 9); // specify first and last item

foreach ($items as $item):
    <div class="blog-discription">
    	<div class="blog-meta">
        	<a class="blog-title" href="<?php echo $item['link']; ?>"><?php  echo $item['title'];?></a>
        <div class="single-blog-content">
			<?php echo $item['description']; ?>

Get post by category id in custom post type with custom taxonomy

Snippet for create custom post type and it’s taxonomy.

$termsID = '191'; #e.i

	$dalwadi_ourteam_args = array(
		'post_type' => 'ourteam',
		'orderby' => 'post_date',               
		'order' => 'DESC',
		'post_status' => 'publish',		
		'tax_query' => array(
				'taxonomy' => 'member-category',
				'field' => 'term_id',
				'terms'    => $ourteam_category_check
	$dalwadi_ourteam = new WP_Query($dalwadi_ourteam_args);
	while ($dalwadi_ourteam->have_posts()) : $dalwadi_ourteam->the_post();
		/*** My loop code ***/