Skip to content

Instantly share code, notes, and snippets.

@akkord87
akkord87 / https
Last active June 30, 2019 21:02
301 редирект со всех http-адресов страниц на соответствующие новые адреса с https
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
@akkord87
akkord87 / google-search.html
Created April 20, 2018 07:54
Форма от google
<form action="/search.html" id="cse-search-box">
<input type="hidden" name="cx" value="partner-pub-xxx:xxx" />
<input type="hidden" name="cof" value="FORID:10" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" placeholder="Поиск по сайту..." />
</form>
@akkord87
akkord87 / srcset.php
Created March 11, 2018 10:29
Отключаем srcset и sizes для картинок в WordPress
/**
* Отключаем srcset и sizes для картинок в WordPress
*/
// Отменяем srcset
// выходим на раннем этапе, этот фильтр лучше чем 'wp_calculate_image_srcset'
add_filter('wp_calculate_image_srcset_meta', '__return_null' );
// Отменяем sizes - это поздний фильтр, но раннего как для srcset пока нет...
add_filter('wp_calculate_image_sizes', '__return_false', 99 );
@akkord87
akkord87 / humburger.html
Created January 15, 2018 19:40
humburger
humburger
@akkord87
akkord87 / robots.txt
Created November 21, 2017 07:05
robots для WP
User-agent: Yandex
Allow: /wp-content/themes/НАЗВАНИЕ_МЕТЫ/
Disallow: /cgi-bin/
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /wp-content/plugins/
Disallow: /wp-content/cache/
Disallow: /wp-json/
Disallow: /wp-content/languages/
Disallow: /wp-content/upgrade/
@akkord87
akkord87 / goal-contact-form-7
Last active November 15, 2017 14:38
Цели contact-form-7
<?php
/*----------------------------------—
* Редирект на страницу благодарности
------------------------------------*/
add_action('wp_footer', 'redirect_sendmail'); #назвине функции
function redirect_sendmail() { #назвине функции
@akkord87
akkord87 / small-devices-animate.css
Created November 13, 2017 19:35
Отключить анимация на <768px
/* Small Devices, Tablets */
@media only screen and (max-width : 768px) {
.animated {
/*CSS transitions*/
-o-transition-property: none !important;
-moz-transition-property: none !important;
-ms-transition-property: none !important;
-webkit-transition-property: none !important;
transition-property: none !important;
/*CSS transforms*/
@akkord87
akkord87 / mail.php
Last active June 11, 2019 15:05
Отправка email
<?php
$recepient = "akkord_87@mail.ru";
$sitename = "el-case.ru";
$name = trim($_POST["name"]);
$phone = trim($_POST["phone"]);
$email = trim($_POST["email"]);
$msg = trim($_POST["massage"]);
@akkord87
akkord87 / auto-time-magnific
Created June 24, 2017 09:39
Автоматически открываем Magnific Popup
// Подключаем Magnific Popup по стандарту и для открытия модального окна на определенную страницу добавляем HTML
$(window).load(function() {
setTimeout(function() {
$.magnificPopup.open({
items: {src: '#popup-form'},type: 'inline'
});
@akkord87
akkord87 / 301-https.php
Created June 15, 2017 15:33
301 редирект с http на https
# SSL: 301 redirect to https from http
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>