This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$catTerms = get_terms('product_cat', array( | |
'hide_empty' => 0, | |
'orderby' => 'ASC', | |
'child_of'=>'30' // air sampling applications | |
)); | |
echo '<ul>'; | |
foreach($catTerms as $catTerm) { | |
echo '<li> | |
<a href="'. get_term_link($catTerm) .'" >' . $catTerm->name.'</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
woocommerce trim countrycode before submission | |
add_action( 'woocommerce_checkout_create_order', 'additional_hidden_checkout_field_save', 20, 2 ); | |
function additional_hidden_checkout_field_save( $order, $data ) { | |
if( ! isset($data['billing_phone']) ) return; | |
if( ! empty($data['billing_phone']) ){ | |
$phone = str_replace([' ','-','_'],['','',''], $data['billing_phone']); | |
$phone = ltrim(ltrim($phone, '0'),'+88'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="social-link"> | |
<li> | |
<a href=""><i class="fa fa-facebook"></i></a> | |
</li> | |
<li> | |
<a href="#"><i class="fa fa-twitter"></i></a> | |
</li> | |
<li> | |
<a href="#"><i class="fa fa-pinterest"></i></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.home .header-categories-nav .categories-menu-dropdown | |
{ | |
visibility: visible; | |
opacity: 1; | |
transform: none; | |
pointer-events: visible; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sorting out of stock WooCommerce products - Order product collections by stock status, in-stock products first. | |
*/ | |
class iWC_Orderby_Stock_Status | |
{ | |
public function __construct() | |
{ | |
// Check if WooCommerce is active | |
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) { | |
add_filter('posts_clauses', array($this, 'order_by_stock_status'), 2000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/^(?:\+88|01)?(01){1}[3456789]{1}(?:\d{13}|\d{11})$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. https://www.regextester.com/96826 | |
2. https://regexr.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$difference = strtotime($list_vids['ExpirationDate']) - strtotime($now); | |
$hours = $difference / 3600; // 3600 seconds in an hour | |
$minutes = ($hours - floor($hours)) * 60; | |
$final_hours = round($hours,0); | |
$final_minutes = round($minutes); |