Skip to content

Instantly share code, notes, and snippets.

@mpodaniev
mpodaniev / fix_IE_FlexAlign.css
Last active June 12, 2020 09:27
Fix align-items: center; for IE
.container-flex::after {
content: '';
min-height: inherit;
font-size: 0;
/* or
content: "";
display: inline-block;
min-height: inherit;
visibility: hidden; */
@mpodaniev
mpodaniev / textwrap.css
Created March 14, 2018 13:36
Обрезка текста с добавлением окончания в виде многоточия, "…"
p {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 200px;
}
@mpodaniev
mpodaniev / is_mobile.js
Created September 6, 2017 17:58
Определение типа устройства
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
// код для мобильных устройств
} else {
// код для обычных устройств
}
@mpodaniev
mpodaniev / mail_send.php
Last active June 15, 2017 09:54
Проверка отправки почты с сайта
$to="mpodanev@gmail.com"; // заменить на свою почту
$headers = "Content-type: text/html; charset=utf-8 \r\n";
$headers.= "From: ".$_SERVER['SERVER_NAME']." \r\n";
$subject="Сообщение с сайта ".$_SERVER['SERVER_NAME'];
$message="Тест";
mail("mpodanev@gmail.com", "Test", "Test message");
@mpodaniev
mpodaniev / style.scss
Last active March 30, 2018 08:58
Миксины
@mixin clearfix() {
&::after {
content: '';
display: table;
clear: both;
}
}
//Базовый адаптивный контейнер
@mpodaniev
mpodaniev / style.css
Last active July 10, 2020 11:02
Базовые стили
//Правильное присвоение border-box для всех элементов
html {
box-sizing: border-box;
}
*, *::before, *::after {
box-sizing: inherit;
}
//Присвоение для конкретного элемента
.content-box-coponent {
box-sizing: content-box;
@mpodaniev
mpodaniev / delete tag p
Created September 6, 2016 19:04
Убираем пустые параграфы в местах перевода строк - functions.php
<?php
remove_filter('the_content', 'wpautop');
@mpodaniev
mpodaniev / WordPress Get Category Description by Slug
Last active July 8, 2016 12:11
Получаем описание рубрики по ярлыку
<?php echo category_description( get_category_by_slug('category-slug')->term_id ); ?>
@mpodaniev
mpodaniev / WordPress Get Category name By label
Last active July 8, 2016 12:12 — forked from agragregra/WordPress Get Category name By label
Получаем Название Рубрики по ярлыку
<?php
$idObj = get_category_by_slug('s_about');
$id = $idObj->term_id;
echo get_cat_name($id);
?>
/* Small Devices, Tablets */
@media only screen and (max-width : 768px) {
.animated {
/*CSS transitions*/
-o-transition-property: none !important;
-moz-transition-property: none !important;
-ms-transition-property: none !important;
-webkit-transition-property: none !important;
transition-property: none !important;
/*CSS transforms*/