Skip to content

Instantly share code, notes, and snippets.

View Nabozhev's full-sized avatar
🎓
Researching knowledge

Dmitry Nabozhev

🎓
Researching knowledge
View GitHub Profile
@Nabozhev
Nabozhev / main.sass
Created August 15, 2018 22:05
Sass Анимация пульса | Пульсириющий элемент на CSS
@keyframes pulse // animation: pulse 6s infinite;
0%
opacity: 1
50%
opacity: 0
100%
opacity: 1
@Nabozhev
Nabozhev / index.php
Created August 10, 2018 21:33
php узнать путь к каталогу
?>
<?php
echo 'Полный путь к каталогу: ';
echo $_SERVER['DOCUMENT_ROOT'];
echo '/';
?>
@Nabozhev
Nabozhev / common.js
Created July 22, 2018 20:58
Показываем баннер через куки, пока не закроют браузер COOKIE jquery плагин
// Событие по куки
setTimeout(function() {
var kuka = $.cookie('banner-biocare'); //получили значение куки
console.log('Кука содержит: ' + kuka); //Значение куки в лог
if (kuka!='has_been_show') {
console.log('При проверке решено показать баннер'); //Значение куки в лог
$('.banner-biocare').addClass('banner-biocare-show');
console.log('Баннер всплыл');
@Nabozhev
Nabozhev / common.js
Created July 22, 2018 11:50
Перемещение элемента в зависимости от ширины окна
$(window).resize(function() {
if(document.documentElement.clientWidth < 768) {
$('.banner-biocare img').after($('.power_btn'));
console.log('Ok...')
} else {
$('.banner-biocare span').after($('.power_btn'));
console.log('Return...')
}
});
@Nabozhev
Nabozhev / single.php
Created July 19, 2018 13:03
Разный шаблон для single в зависсимости от категории Wordpress УСЛОВИЕ
<?php
$post = $wp_query->post;
if (in_category('4')) {
include(TEMPLATEPATH.'/single-uslugi.php');
} else {
include(TEMPLATEPATH.'/single-default.php');
} elseif (in_category(3)) {
include(TEMPLATEPATH.'/single-stati.php');
}
@Nabozhev
Nabozhev / category-3.php
Created July 19, 2018 12:53
Вывод постов стандартным циклом с навигацией Wordpress
<div class="while_start">
<!-- вывод постов компонентом -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- Item start -->
<div class="stati-item">
<div class="stati-item-left">
<div class="date_item"><?php the_time('j F Y'); ?></div>
@Nabozhev
Nabozhev / Untitled-1
Created July 18, 2018 16:13
Основные комманды Git
<!-- GIT main command -->
<!-- 1 Создание проекта -->
mkdir hello - создать каталог
cd hello - войти в каталог
touch hello.html - создать файл
<!-- Создание/инициализация репозитория -->
git init - создать git репозиторий из этого каталога
@Nabozhev
Nabozhev / common.js
Created July 17, 2018 14:33
Кнопка Наверх плавный скрол вверх страницы
// Кнопка На верх
$(window).scroll(function(){
if($(this).scrollTop() > $(this).height()) {
console.log($(this).height());
console.log($(this).scrollTop());
$('.top').addClass('active');
} else {
$('.top').removeClass('active');
}
});
@Nabozhev
Nabozhev / style.css
Created July 13, 2018 22:43
Правильное подключение шрифтов @font-face
@font-face{
font-family: 'dashicons';
src: url('fonts/dashicons.eot');
src: url('fonts/dashicons.eot?iefix') format('eot'),
url('fonts/dashicons.woff') format('woff'),
@Nabozhev
Nabozhev / page-4996.php
Created July 13, 2018 21:32
Вывод всех комментариев на одной странице Wordpress - Пример такого шаблона
<?php
/*
Template Name: Отзывы
*/
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a