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
| 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
| <!-- 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
| //Аякс отправка форм | |
| //Документация: 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
| // 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
| // Шаблон для постов рубрики работы | |
| 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
| // Добавляем настройки темы | |
| 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
| <?php | |
| // Число 108 замените на идентификатор вашей страницы, которую хотите загрузить: | |
| $page_id = 108; | |
| // Вы должны присвоить идентификатор переменной, иначе WordPress будет генерировать ошибку: | |
| $page_data = get_page( $page_id ); | |
| // Показываем заголовок страницы: | |
| print '<h2>'. $page_data->post_title .'</h2>'; | |
| // Выводим содержимое страницы, сохраняя стандартные фильтры WordPress: | |
| print apply_filters('the_content', $page_data->post_content); | |
| ?> |
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
| // Меняем ссылку страницы поиска на site/search/ | |
| function fb_change_search_url_rewrite() { | |
| if ( is_search() && ! empty( $_GET['s'] ) ) { | |
| wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) ); | |
| exit(); | |
| } | |
| } | |
| add_action( 'template_redirect', 'fb_change_search_url_rewrite' ); |