This file contains hidden or 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
| // Determine if an element is in the visible viewport | |
| function isInViewport(element) { | |
| var rect = element.getBoundingClientRect(); | |
| var html = document.documentElement; | |
| return ( | |
| rect.top >= 0 && | |
| rect.left >= 0 && | |
| rect.bottom <= (window.innerHeight || html.clientHeight) && | |
| rect.right <= (window.innerWidth || html.clientWidth) | |
| ); |
This file contains hidden or 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
| // slider | |
| $slick_slider = $('.slider'); | |
| settings_slider = { | |
| dots: false, | |
| arrows: false | |
| // more settings | |
| } | |
| slick_on_mobile( $slick_slider, settings_slider); | |
| // slick on mobile |
This file contains hidden or 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
| //Скрыть слайдер до инициализации | |
| $('slider').on('init', function(slick){ | |
| $('slider').show(); | |
| }); |
This file contains hidden or 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 | |
| /** | |
| * Выводи на экран значение переменной | |
| * | |
| * @param mixed $data данные для отображения | |
| * @param bool $type как отображать данные | |
| */ | |
| function d( $data, $type = 0 ) { | |
| ob_start(); | |
This file contains hidden or 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 | |
| /** | |
| * Работает на основе плагина Ajax Simply (без него работать не будет). | |
| * Документация Ajax Simply - https://goo.gl/iFeLsZ | |
| */ | |
| // HTML верстка формы и стили | |
| add_shortcode( 'form', 'contact_form_html' ); | |
| function contact_form_html() { |
This file contains hidden or 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 | |
| /** | |
| * Plugin Name: CF7 Modal Invalid Answer | |
| * Plugin URI: https://gist.github.com/campusboy87/a056c288c99feee70058ed24cee805ad | |
| * Author: Campusboy (wp-plus) | |
| * Author URI: https://www.youtube.com/wp-plus | |
| */ | |
| add_action( 'wp_enqueue_scripts', 'wpcf7_modal_invalid_js' ); | |
| add_action( 'wp_footer', 'wpcf7_modal_invalid_js_inline', 999 ); |
This file contains hidden or 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
| var src = "___library/7-kazan/1/*"; | |
| var dst = "_ready"; | |
| var gulp = require('gulp'), | |
| imagemin = require('gulp-imagemin'), | |
| cache = require('gulp-cache'), | |
| del = require('del'), | |
| imageResize = require('gulp-image-resize'), | |
| watermark = require("gulp-watermark"), | |
| rename = require("gulp-rename"); |
This file contains hidden or 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 | |
| $parent_id = 5; | |
| echo '<h2>Услуги</h2>'; | |
| # получаем дочерние рубрики | |
| $sub_cats = get_categories( array( | |
| 'child_of' => $parent_id, | |
| 'hide_empty' => 0 | |
| ) ); | |
| if( $sub_cats ){ |
NewerOlder