Text color blinking using CSS


<h4 class="blinking">SCORE</h4>
.blinking{
	animation:blinkingText 1s infinite;
}
@keyframes blinkingText{
	0%{		color: #fff;	}
	50%{	color: #c00;	}	
	100%{	color: #fff;	}
}
Advertisements

Password protecting your site using .htaccess / .htpasswd

1. Update .htaccess file to the root of your site with the following content:

AuthName "Authorisation Required"
AuthUserFile "/path/to/.htpasswd"
AuthType Basic
require valid-user
ErrorDocument 401 "Authorisation Required"
2. Create & upload the .htpasswd file to ‘AuthUserFile’ path with the following content:
foo:$testing$f#$ffgJHFjhfRGV.
3. generate about line using username & password uaing this site http://www.htaccesstools.com/htpasswd-generator/

How to check selected product in previous customer orders or not

$seletedProduct = 25;
$exist = ‘no’;
if(is_user_logged_in()){      // Check for customer login
$orders = get_posts( array(
‘numberposts’ => -1,
‘meta_key’ => ‘_customer_user’,
‘meta_value’ => get_current_user_id(),
‘post_type’ => ‘shop_order’,
‘post_status’ => array(‘wc-completed’, ‘wc-processing’)
) );
foreach ($orders as $order) {
$WC_Order = new WC_Order($order->ID);
$items = $WC_Order->get_items();
foreach ( $items as $item ) {
if($item[‘product_id’] == $seletedProduct){
$exist = ‘yes’;
}
}
}
}
if($exist == ‘no’){
echo ‘Product not ordered’;
}else{
echo ‘Product already ordered’;
}