body .select2-container, body .ui-widget.ui-datepicker {
z-index: 9000000009!important;
}
.astra-cart-drawer.active {
width: 80%;
z-index: 9999999999;
}
let idash = "<?php echo $imager5?>";
if (document.getElementById(idash).src="<?php echo $imager4?>"){
document.getElementById("per_4").src="<?php echo $imager3 ?>;"
while (have_posts()) : the_post(); // запускаем цикл обхода материалов блога
$imager3 = get_the_post_thumbnail_url( get_the_ID(), 'full' );
$imager4 = get_the_post_thumbnail_url( get_the_ID(), 'medium' );
$imager5 = get_the_ID();
?>
<img src="<?php echo $imager4 ?>" id="<?php echo $imager5?>" onClick="chg2('<?php echo $imager3 ?>', '<?php echo $imager4 ?>', '<?php echo $imager4 ?>')">
<?php
endwhile; // завершаем цикл.
<script>
function chg2(imager3, imager4, imager5 ){
let idash = imager4
if (document.getElementById(idash).src=imager4){
document.getElementById("per_4").src=imager5
}
}
</script>
$WC_Cart = new WC_Cart();
echo $WC_Cart->get_cart_contents_count();
//ПОДСЧЕТ ОБЩЕЙ ОЦЕНКИ.
function comm_rating_get_average_ratings( $id ) {
$comments = get_approved_comments( $id );
if ( $comments ) {
$i = 0;
$total = 0;
foreach( $comments as $comment ){
$rate = get_comment_meta( $comment->comment_ID, 'rating', true );
if( isset( $rate ) && '' !== $rate && $rate < 2.5 ) {
$i++;
}
}
if ( 0 === $i ) {
return false;
} else {
return $i;
}
} else {
return false;
}
}
add_action('login_head', function(){
?>
<style>
#registerform > p:first-child{
display:none;
}
</style>
<script type="text/javascript" src="<?php echo site_url('/wp-includes/js/jquery/jquery.js'); ?>"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
$('#registerform > p:first-child').css('display', 'none');
});
</script>
<?php
});
//Remove error for username, only show error for email only.
add_filter('registration_errors', function($wp_error, $sanitized_user_login, $user_email){
if(isset($wp_error->errors['empty_username'])){
unset($wp_error->errors['empty_username']);
}
if(isset($wp_error->errors['username_exists'])){
unset($wp_error->errors['username_exists']);
}
return $wp_error;
}, 10, 3);
add_action('login_form_register', function(){
if(!isset($_POST['user_login']) && isset($_POST['user_email']) && !empty($_POST['user_email'])){
$_POST['user_login'] = $_POST['user_email'];
}
});