Skip to content

Instantly share code, notes, and snippets.

View muks999's full-sized avatar

Muks999 muks999

View GitHub Profile
@muks999
muks999 / pug.md
Created May 10, 2019 17:47 — forked from neretin-trike/pug.md
Туториал по HTML препроцессору Pug (Jade)
/*
* Function for post duplication. Dups appear as drafts. User is redirected to the edit screen
*/
function rd_duplicate_post_as_draft(){
global $wpdb;
if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'rd_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) {
wp_die('No post to duplicate has been supplied!');
}
/*
@muks999
muks999 / .htaccess
Created October 9, 2018 13:03 — forked from artikus11/.htaccess
Заготовка для подключения браузерного кеширования
Включение кеша браузера
=====
Вариант 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"
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
},
});
@muks999
muks999 / Modal2Divi
Created October 9, 2018 13:02 — forked from artikus11/Modal2Divi
Инициализация всплывающего окна для темы Divi
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#modal1, #modal-1').magnificPopup({
type: 'inline',
preloader: false,
callbacks: {
beforeOpen: function() {
if($(window).width() < 700) {
this.st.focus = false;
} else {
@muks999
muks999 / Featured image
Created October 9, 2018 13:00 — forked from artikus11/Featured image
Колонки с миниатюрами в админке
@muks999
muks999 / getDeviceType
Created October 9, 2018 13:00 — forked from artikus11/getDeviceType
Функция определения типа устройства
define("DEV_DEFAULT", 0);
define("ANDROID", 1);
define("IOS", 2);
function getDeviceType(){
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
if(stripos($ua,'android') !== false) { return ANDROID; }
if(stripos($ua,'iPhone') !== false) { return IOS;}
if(stripos($ua,'iPad') !== false) { return IOS; }
return DEV_DEFAULT;
}
@muks999
muks999 / wp_security_setting
Created October 9, 2018 13:00 — forked from artikus11/wp_security_setting
Настройки для плагина All In One WP Security
{"aiowps_enable_debug":"","aiowps_remove_wp_generator_meta_info":"1","aiowps_prevent_hotlinking":"1","aiowps_enable_login_lockdown":"1","aiowps_allow_unlock_requests":"","aiowps_max_login_attempts":3,"aiowps_retry_time_period":5,"aiowps_lockout_time_length":60,"aiowps_set_generic_login_msg":"","aiowps_enable_email_notify":"","aiowps_email_address":"[email protected]","aiowps_enable_forced_logout":"","aiowps_logout_time_period":"60","aiowps_enable_invalid_username_lockdown":"","aiowps_instantly_lockout_specific_usernames":[],"aiowps_unlock_request_secret_key":"9boae3otjbi5x7b7q6kf","aiowps_enable_whitelisting":"","aiowps_allowed_ip_addresses":"","aiowps_enable_login_captcha":"","aiowps_enable_custom_login_captcha":"","aiowps_captcha_secret_key":"y9t13745ja38h0dirf5q","aiowps_enable_manual_registration_approval":"","aiowps_enable_registration_page_captcha":"","aiowps_enable_random_prefix":"","aiowps_enable_automated_backups":"1","aiowps_db_backup_frequency":2,"aiowps_db_backup_interval":"2","aiowps_backup_files_s
@muks999
muks999 / functions.php
Created October 9, 2018 13:00 — forked from artikus11/functions.php
Подключение дочерней темы в файле functions.php
add_action( 'wp_enqueue_scripts', 'artabr_child_theme_enqueue_styles' );
function artabr_child_theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'parent-style' ), wp_get_theme()->get( 'Version' ) );
}
@muks999
muks999 / functions.php
Created October 9, 2018 12:59 — forked from artikus11/functions.php
Переопределение классов и контенеров для виджета Произвольное меню
add_filter( 'widget_nav_menu_args', 'artabr_widget_menu_category' );
function artabr_widget_menu_category ($arg) {
$arg['container'] = 'div';
$arg['container_class'] = 'rubric__list side__menu';
$arg['menu_class'] = '';
return $arg;
}