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
| function wptuts_opengraph_for_posts() { | |
| if ( is_singular() ) { | |
| global $post; | |
| setup_postdata( $post ); | |
| $output = '<meta property="og:type" content="article" />' . "\n"; | |
| $output .= '<meta property="og:title" content="' . esc_attr( get_the_title() ) . '" />' . "\n"; | |
| $output .= '<meta property="og:url" content="' . get_permalink() . '" />' . "\n"; | |
| $output .= '<meta property="og:description" content="' . esc_attr( get_the_excerpt() ) . '" />' . "\n"; | |
| if ( has_post_thumbnail() ) { | |
| $imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' ); |
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
| if( ! is_admin() ) { | |
| wp_deregister_script( 'jquery' ); | |
| wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js', false, null); | |
| wp_enqueue_script( 'jquery' ); | |
| } |
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
| (function(){ // анонимная функция (function(){ })(), чтобы переменные "a" и "b" не стали глобальными | |
| var a = document.querySelector('#share-area'), b = null; // селектор блока, который нужно закрепить | |
| window.addEventListener('scroll', Ascroll, false); | |
| document.body.addEventListener('scroll', Ascroll, false); // если у html и body высота равна 100% | |
| function Ascroll() { | |
| if (b == null) { // добавить потомка-обёртку, чтобы убрать зависимость с соседями | |
| var Sa = getComputedStyle(a, ''), s = ''; | |
| for (var i = 0; i < Sa.length; i++) { // перечислить стили CSS, которые нужно скопировать с родителя | |
| if (Sa[i].indexOf('overflow') == 0 || Sa[i].indexOf('padding') == 0 || Sa[i].indexOf('border') == 0 || Sa[i].indexOf('outline') == 0 || Sa[i].indexOf('box-shadow') == 0 || Sa[i].indexOf('background') == 0) { | |
| s += Sa[i] + ': ' +Sa.getPropertyValue(Sa[i]) + '; ' |
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
| add_action( 'wp_footer', 'mycustom_wp_footer' ); | |
| function mycustom_wp_footer() { | |
| ?> | |
| <script type="text/javascript"> | |
| document.addEventListener( 'wpcf7mailsent', function( event ) { | |
| setTimeout(function () { | |
| $.magnificPopup.close(); | |
| }, 1500); | |
| }, false ); | |
| </script> |
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
| .cbp-so-init .cbp-so-side { | |
| opacity: 0; | |
| -webkit-transition: none; | |
| -moz-transition: none; | |
| transition: none; | |
| } | |
| .cbp-so-init .cbp-so-side-left { | |
| -webkit-transform: translateX(-200px); |
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
| $('#spoiler-opener a').click(function (e) { | |
| $('.spoiler').slideToggle(1000); | |
| $('#spoiler-opener a .fa').toggleClass("opener-open"); | |
| $('#spoiler-opener a .fa').toggleClass("opener-closed"); | |
| //$.scrollTo('.spoiler', 1000); | |
| e.preventDefault(); | |
| }); | |
| <div class="spoiler"> | |
| <div id="spoiler-opener" class="spoiler-opener"> |
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
| $(window).scroll(function () { | |
| if ($(this).scrollTop() > 300) { | |
| $('.scroll-to-top').fadeIn(); | |
| } else { | |
| $('.scroll-to-top').fadeOut(); | |
| } | |
| }); | |
| $('.scroll-to-top').click(function () { | |
| $('body,html').animate({ | |
| scrollTop: 0 |
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
| <!-- Preloader --> | |
| <div class="loaderArea"> | |
| <div class="loader"></div> | |
| </div> | |
| <style> | |
| .loaderArea { | |
| background: #fff; | |
| overflow: hidden; | |
| position: fixed; | |
| left: 0; |
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
| $(document).ready(function($) { | |
| var onMapMouseleaveHandler = function(event) { | |
| var that = $(this); | |
| that.on('click', onMapClickHandler); | |
| that.off('mouseleave', onMapMouseleaveHandler); | |
| that.find('iframe').css("pointer-events", "none"); | |
| }; | |
| var onMapClickHandler = function(event) { | |
| var that = $(this); |