This file contains 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
<button class="btn btn__toggle"> | |
<svg class="ham" viewBox="0 0 100 100" onclick="this.classList.toggle('active')"> | |
<path class="ham__line top" d="m 70,33 h -40 c 0,0 -6,1.368796 -6,8.5 0,7.131204 6,8.5013 6,8.5013 l 20,-0.0013" /> | |
<path class="ham__line middle" d="m 70,50 h -40" /> | |
<path class="ham__line bottom" d="m 69.575405,67.073826 h -40 c -5.592752,0 -6.873604,-9.348582 1.371031,-9.348582 8.244634,0 19.053564,21.797129 19.053564,12.274756 l 0,-40" /> | |
</svg> | |
</button> |
This file contains 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( 'wpseo_robots', 'yoast_seo_robots_change' ); | |
function yoast_seo_robots_change( $robots ) { | |
if (is_page(1496) || is_page(1496) ) { | |
$robots = "noindex, nofollow"; | |
return $robots; | |
} | |
return $robots; | |
} |
This file contains 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
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} !(.*)/$ | |
RewriteCond %{REQUEST_URI} !^/wp-json | |
RewriteCond %{REQUEST_URI} !.xml$ | |
RewriteRule ^(.*[^/])$ $1/ [L,R=301] |
This file contains 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_action( 'after_setup_theme', 'mythemeslug_theme_setup' ); | |
if ( ! function_exists( 'mythemeslug_theme_setup' ) ) { | |
function mythemeslug_theme_setup(){ | |
/********* Registers an editor stylesheet for the theme ***********/ | |
add_action( 'admin_init', 'mythemeslug_theme_add_editor_styles' ); | |
/********* TinyMCE Buttons ***********/ | |
add_action( 'init', 'mythemeslug_buttons' ); | |
} |
This file contains 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
$acfParent = acf_add_options_page(array( | |
'page_title' => 'Основные настройки темы', | |
'menu_title' => 'Настройка темы', | |
'menu_slug' => 'theme-general-settings', | |
'capability' => 'edit_posts', | |
'redirect' => false | |
)); | |
$acfChild = acf_add_options_sub_page(array( | |
'page_title' => 'Скрипты', | |
'menu_title' => 'Скрипты', |
This file contains 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
jQuery(document).on('click',function (e) { | |
var el = '.element'; | |
if (jQuery(e.target).closest(el).length) return; | |
// дальше пишем код который нужно выполнить по клику вне элемента | |
}); |
This file contains 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 wpml_url_fix( $languages ) { | |
// make your changes to the $languages array here. | |
if($languages['ru']['url'] == site_url()."/sitemap") { | |
$languages['ru']['url'] = site_url()."/sitemap.html"; | |
} | |
if($languages['ua']['url'] == site_url()."/ua/sitemapua") { | |
$languages['ua']['url'] = site_url()."/ua/sitemap.html"; | |
} | |
return $languages; |
This file contains 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( 'wp_get_attachment_image_attributes', 'add_title_attachment_image', 10, 3 ); | |
function add_title_attachment_image( $attr, $attachment, $size ){ | |
if(empty($attr['title'])) $attr['title'] = $attr['alt']; | |
return $attr; | |
} | |
function add_alt_tags($content) | |
{ | |
global $post; | |
preg_match_all('/<img (.*?)\/>/', $content, $images); |
This file contains 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
// Изменяем атрибут class у тега li | |
add_filter( 'nav_menu_css_class', 'filter_nav_menu_css_classes', 10, 4 ); | |
function filter_nav_menu_css_classes( $classes, $item, $args, $depth ) { | |
if ( $args->theme_location === 'header_menu' ) { | |
if($depth == 1) { | |
$classes = ['header-podmenu_list']; | |
} else { | |
$classes = ['header-menu_list']; | |
} | |
if ( $item->current ) { |
This file contains 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( 'wpseo_title', 'add_paged_title_category_wc' ); | |
function add_paged_title_category_wc($title) { | |
$paged = get_query_var('paged') ? get_query_var('paged') : 1; | |
if ( is_tax('product_cat') && $paged > 1) { | |
$newTitle = 'Страница '.$paged.', '. $title; | |
return $newTitle; | |
} | |
} | |
add_filter( 'wpseo_metadesc', 'add_paged_descr_category_wc' ); | |
function add_paged_descr_category_wc($descr) { |
NewerOlder