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('customize_register', function($customizer) { | |
| $customizer->add_section( | |
| 'section_one', array( | |
| 'title' => 'Настройки сайта', | |
| 'description' => '', | |
| 'priority' => 11, | |
| ) | |
| ); | |
| $customizer->add_setting('phone', |
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 wpse_custom_category_single_template( $single_template ) { | |
| global $post; | |
| // get all categories of current post | |
| $categories = get_the_category( $post->ID ); | |
| $top_categories = array(); | |
| // get top level categories |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| //Аякс отправка форм | |
| //Документация: http://api.jquery.com/jquery.ajax/ | |
| $("#form, #form2").submit(function(e) { | |
| e.preventDefault; | |
| $.ajax({ | |
| type: "POST", | |
| url: "mail.php", | |
| data: $(this).serialize() | |
| }).done(function() { | |
| alert("Спасибо за заявку!"); |
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
| <!-- Bootstrap trigger to open modal --> | |
| <a data-toggle="modal" href="#rating-modal">Write a Review</a> | |
| <div class="hide fade modal" id="rating-modal"> | |
| <div class="modal-header"> | |
| <button type="button" class="close" data-dismiss="modal">×</button> | |
| <h2>Your Review</h2> | |
| </div> | |
| <div class="modal-body"> |
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
| html { | |
| box-sizing: border-box; | |
| } | |
| *, *:before, *:after { | |
| box-sizing: inherit; | |
| } |
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
| $('.gallery').each(function() { | |
| $(this).magnificPopup({ | |
| delegate: 'a', | |
| type: 'image', | |
| fixedContentPos: false, | |
| fixedBgPos: false, | |
| callbacks: { | |
| open: function() { | |
| $('body').addClass('noscroll'); | |
| }, |
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
| $('.callback-form').each(function(){ | |
| // Объявляем переменные (форма и кнопка отправки) | |
| var form = $(this), | |
| btn = form.find('.callback-form__submit'); | |
| // Добавляем каждому проверяемому полю, указание что поле пустое | |
| form.find('.callback-form__input').addClass('empty'); | |
| // Функция проверки полей формы | |
| function checkInput(){ |
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
| $('a[href*=#]:not([href=#])').click(function() { | |
| if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
| var target = $(this.hash); | |
| target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
| if (target.length) { | |
| $('html,body').animate({ | |
| scrollTop: target.offset().top - 56 | |
| }, 500); | |
| return false; | |
| } |