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
jQuery(function($){ | |
$(document).mouseup(function (e){ // событие клика по веб-документу | |
let div = $('#popup'); // тут указываем ID элемента | |
if (!div.is(e.target) // если клик был не по нашему блоку | |
&& div.has(e.target).length === 0) { // и не по его дочерним элементам | |
div.hide(); // скрываем его | |
} | |
}); | |
}); |
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
<style> .wow{ opacity: 0; } </style> | |
<script> function afterReveal( el ) { el.addEventListener('animationstart', function( event ) { $('.wow').each(function(){ $(this).css('opacity',1); }); }); } new WOW({ callback: afterReveal }).init() </script> |
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
.my-slider .slick-dots { | |
position: absolute; | |
bottom: -15px; | |
left: 50%; | |
z-index: 1; | |
display: flex; | |
flex-wrap: wrap; | |
list-style: none; | |
margin: 0; | |
padding: 0; |
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
.my-slider.slick-initialized .slick-track { | |
display: flex !important; | |
} | |
.my-slider.slick-initialized .slick-slide { | |
display: flex; | |
height: inherit !important; | |
} | |
.my-slider.slick-initialized .slick-slide > div { |
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
// redirect with http on https | |
$use_sts = true; | |
if ($use_sts && isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') { | |
header('Strict-Transport-Security: max-age=31536000'); | |
} elseif ($use_sts) { | |
header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], true, 301); | |
die(); | |
} |
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
/** | |
* Генерирует webp копии изображений сразу после загрузки изображения в медиабиблиотеку | |
* | |
* - новые файлы сохраняет с именем name.ext.webp, например, thumb.jpg.webp | |
*/ | |
function gt_webp_generation($metadata) { | |
$uploads = wp_upload_dir(); // получает папку для загрузки медиафайлов | |
$file = $uploads['basedir'] . '/' . $metadata['file']; // получает исходный файл | |
$ext = wp_check_filetype($file); // получает расширение файла |
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
##### Перемещение курсора: | |
Ctrl + a — переход в начало строки | |
Ctrl + b — переход на 1 символ назад | |
Ctrl + c — посылает программе SIGINT. Обычно, прерывает текущее задание | |
Ctrl + d — удаляет символ под курсором (аналог delete) | |
Ctrl + e — переход к концу строки | |
Ctrl + f — переход на 1 символ вперёд | |
Ctrl + xx — переходит от текущей позиции курса в начало строки и обратно. | |
Ctrl + p — Предыдущая команда (Стрелка вверх) |
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
<h2 id="authors">Authors</h2> | |
<ul> | |
<?php | |
wp_list_authors( | |
array( | |
'exclude_admin' => false, | |
) | |
); | |
?> | |
</ul> |
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 if ( has_post_thumbnail()) : ?> | |
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" > | |
<?php the_post_thumbnail(); ?> | |
</a> | |
<?php endif; ?> |
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 if ( have_posts() ) : query_posts('p=1'); | |
while (have_posts()) : the_post(); ?> | |
<?php the_title(); ?> | |
<?php the_content(); ?> | |
<?php the_post_thumbnail(array(100, 100)); ?> | |
<?php endwhile; endif; wp_reset_query(); ?> |
NewerOlder