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_xml_sitemap_img', '__return_false' ); |
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
/** | |
* Руссифицирует месяца и недели в дате. | |
* Функция для фильтра date_i18n. | |
* @param строка $date Дата в принятом формате | |
* @param строка $req_format Формат передаваемой даты | |
* @return Дату в русском формате | |
*/ | |
function russify_months( $date, $req_format ){ | |
// в формате есть "строковые" неделя или месяц | |
if( ! preg_match('~[FMlSD]~', $req_format ) ) return $date; |
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 art_get_featured_image($post_ID) { | |
$post_thumbnail_id = get_post_thumbnail_id($post_ID); | |
if ($post_thumbnail_id) { | |
$post_thumbnail_img = wp_get_attachment_image_src($post_thumbnail_id, 'thumbnail'); | |
return $post_thumbnail_img[0]; | |
} | |
} |
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
Включение кеша браузера | |
===== | |
Вариант 1 | |
=== | |
<ifModule mod_headers.c> | |
<FilesMatch "\.(js|css|txt)$"> | |
Header set Cache-Control "max-age=604800" | |
</FilesMatch> | |
<FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$"> | |
Header set Cache-Control "max-age=2592000" |
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).ready(function($) { | |
$(".post__body").magnificPopup({ | |
delegate: "p a[href$='.jpg'],p a[href$='.jpeg'],p a[href$='.gif'],p a[href$='.png']", | |
type: 'image', | |
closeOnContentClick: true, | |
mainClass: 'mfp-img-mobile', | |
image: { | |
verticalFit: true | |
}, | |
}); |
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( 'woocommerce_register_post_type_product', 'artabr_modify_product_post_type' ); | |
function artabr_modify_product_post_type( $args ) { | |
$args['labels']['name'] = 'Услуги'; | |
$args['labels']['singular_name'] = 'Услуга'; | |
$args['labels']['menu_name'] = 'Услуги'; | |
return $args; | |
} |
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 WC_Ya_delivery_Picpoint extends WC_Shipping_Method { | |
public function __construct( $instance_id = 0 ) { | |
$this->id = 'ya_delivery_picpoint'; | |
$this->method_title = 'Яндекс.Доставка - Самовывоз'; | |
$this->instance_id = absint( $instance_id ); | |
$this->supports = array( | |
'shipping-zones', | |
'instance-settings', | |
); |
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( 'woocommerce_states', 'artabr_woo_region_russia' ); | |
function artabr_woo_region_russia( $states ) { | |
$states['RU'] = array( | |
"МОСКВА" => " Москва", | |
"САНКТ-ПЕТЕРБУРГ" => " Санкт-Петербург", | |
"АБАКАН" => " Абакан", | |
"АНАДЫРЬ" => " Анадырь", | |
"АНАПА" => " Анапа", | |
"АРХАНГЕЛЬСК" => " Архангельск", | |
"АСТРАХАНЬ" => " Астрахань", |
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 Featured meta to Publish box | |
add_action('post_submitbox_misc_actions', 'mts_featured_post_field'); | |
function mts_featured_post_field () { | |
global $post; | |
/* check if this is a post, if not then we won't add the custom field */ | |
/* change this post type to any type you want to add the custom field to */ | |
if (get_post_type($post) != 'post') | |
return false; | |
OlderNewer