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
add_filter('body_class','browser_body_class'); | |
function browser_body_class($classes) { | |
global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone; | |
if($is_lynx) $classes[] = 'lynx'; | |
elseif($is_gecko) $classes[] = 'gecko'; | |
elseif($is_opera) $classes[] = 'opera'; | |
elseif($is_NS4) $classes[] = 'ns4'; | |
elseif($is_safari) $classes[] = 'safari'; | |
elseif($is_chrome) $classes[] = 'chrome'; |
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 | |
function xmas_closed(){ | |
global $woocommerce; | |
date_default_timezone_set('Europe/Stockholm'); | |
$current_date=date("m-d"); | |
$open_from="14:00"; | |
$open_till="22:00"; | |
$current_time=date("H:i"); | |
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
//Get product term_id | |
$category = get_the_terms(get_the_ID(),'product_cat'); | |
$p_term_id=key($category); | |
$p_term_obj=get_term_by('id', $p_term_id, 'product_cat'); | |
$p_term_tree = get_ancestors($p_term_id, 'product_cat'); | |
if(!$p_term_tree) { | |
//this product category is a top level category | |
$p_top_term=$p_term_id; | |
} else { | |
$p_top_term=end($p_term_tree); |
NewerOlder