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
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
<?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
// 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 | |
/** | |
* Remove the h1 tag from the WordPress editor. | |
* | |
* @param array $settings The array of editor settings | |
* @return array The modified edit settings | |
*/ | |
function remove_h1_from_editor( $settings ) { | |
$settings['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre;'; | |
return $settings; |
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 get_flexible_loop($page_id = null){ | |
if(have_rows('flexible', $page_id)) { | |
while (have_rows('flexible', $page_id)) { | |
the_row(); | |
$section_name = str_replace('_', '-', get_row_layout()); | |
get_template_part("/parts/flexible/{$section_name}"); | |
} | |
} |
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 | |
add_filter('request', 'rudr_change_term_request', 1, 1 ); | |
function rudr_change_term_request($query){ | |
$tax_name = 'kapers'; // specify you taxonomy name here, it can be also 'category' or 'post_tag' | |
// Request for child terms differs, we should make an additional check | |
if( isset($query['attachment']) && $query['attachment']) : |
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
RewriteCond %{THE_REQUEST} \ (.*)//+ | |
RewriteRule (.*) https://www.kaper.pro/$1 [R=301,L] |
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_filter( 'wpcf7_form_elements', 'do_shortcode' ); | |
function pure_url_cf7_func() { | |
$submission = WPCF7_Submission::get_instance(); | |
$url = $submission->get_meta( 'url' ); | |
return strtok($url, '?'); | |
} | |
add_shortcode('puress_url', 'pure_url_cf7_func'); | |
wpcf7_add_form_tag('puress_url', 'pure_url_cf7_func'); |
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 setDefaultHrefImage() { | |
wp_enqueue_script( | |
'modify-image-link-destination-default', | |
get_template_directory_uri() . '/js/setDefaultHrefImage.js', | |
array('wp-hooks') | |
); | |
} | |
add_action('enqueue_block_editor_assets', 'setDefaultHrefImage'); |