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
// Method #1 | |
var num = 1234567890; | |
var result = num.toLocaleString(); // or .toLocaleString('ru'); | |
console.log(result); | |
// Method #2 | |
function numberWithSpaces(x) { | |
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "); | |
} | |
console.log(numberWithSpaces(100)); |
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 | |
// fix when zero in end url | |
add_action( 'pre_handle_404', 'fix_fake_page' ); | |
function fix_fake_page( $false ) { | |
global $wp_query; | |
if ( is_singular() | |
&& isset( $wp_query->query['page'] ) | |
&& $wp_query->query['page'] === '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
node_modules/ | |
build/ | |
# Created by https://www.gitignore.io/api/vue,node,sass,macos,vuejs,nuxtjs,phpstorm,visualstudiocode | |
# Edit at https://www.gitignore.io/?templates=vue,node,sass,macos,vuejs,nuxtjs,phpstorm,visualstudiocode | |
### macOS ### | |
# General | |
.DS_Store | |
.AppleDouble |
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
<div class="ytvideo"> | |
<a class="ytvideo__link" href="https://youtu.be/tTHiLxPHwWo" data-id="tTHiLxPHwWo"> | |
<picture> | |
<img class="ytvideo__media img lazyload" data-src="http://img.youtube.com/vi/tTHiLxPHwWo/0.jpg" alt="Отзыв"> | |
</picture> | |
</a> | |
<button class="ytvideo__button" type="button" aria-label="Запустить видео"> | |
<svg width="68" height="48" viewBox="0 0 68 48"> | |
<path class="ytvideo__button-shape" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z"></path> | |
<path class="ytvideo__button-icon" d="M 45,24 27,14 27,34"></path> |
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
<div class="menu-wrapper"> | |
<div class="hamburger-menu"></div> | |
</div> | |
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 declOfNum(n, titles) { | |
return titles[(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)]; | |
} | |
/* | |
use: declOfNum(count, ['найдена', 'найдено', 'найдены']); | |
*/ |
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
/** | |
* Javascript for Load More | |
* | |
*/ | |
function be_load_more_js() { | |
$query = array( | |
'posts_per_page' => 6, | |
'post_type' => 'reviews' |
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
.expl { | |
background-image: url("data:image/svg+xml;utf8,<svg width='100%' height='100%' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill: none; stroke: #d9d3cb; stroke-width: 4; stroke-dasharray: 8 8'/></svg>"); | |
} |
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('init', 'mp_register_reviews'); | |
function mp_register_reviews(){ | |
register_post_type('reviews', array( | |
'labels' => array( | |
'name' => 'Отзывы', // Основное название типа записи | |
'singular_name' => 'Отзыв', // отдельное название записи типа Book | |
'add_new' => 'Добавить новый отзыв', | |
'add_new_item' => 'Добавить новый отзыв', | |
'edit_item' => 'Редактировать отзыв', | |
'new_item' => 'Новый отзыв', |
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
DELETE FROM wp_posts WHERE post_type = "revision"; |