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
/* Normalize & reset | |
===================================================================================================*/ | |
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;vertical-align:baseline;font-weight:normal;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border- |
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( 'pre_get_posts', 'man_work_cat_post_per_page' ); | |
function man_work_cat_post_per_page( $query ) { | |
$blog_cat_id = carbon_get_theme_option('ib_cat_blog'); | |
if( $query->is_main_query() && is_category( $blog_cat_id ) && ! is_admin() ) { | |
$query->set( 'posts_per_page', '10' ); | |
} |
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
//comments.php | |
<?php | |
if ( comments_open() ) { | |
$commenter = wp_get_current_commenter(); | |
?> | |
<!--noindex--> | |
<?php | |
$args = array( | |
'title_reply_before' => '<div id="reply-title" class="comment-reply-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
Новое по javascript | |
Дождаться загрузки DOM | |
var ready = (callback) => { | |
if (document.readyState != "loading") callback(); | |
else document.addEventListener("DOMContentLoaded", callback); | |
} | |
ready(() => { |
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
Здесь описан код (для WordPress), позволяющий растянуть видео с Ютуба на 100% ширины текстового блока с сохранением пропорций по вертикали. | |
Сработает в случае, если видео в визуальном редакторе вставляется просто ссылкой http://joxi.ru/a2X7zlWIwMV6Zm | |
или кодом <iframe src="https://www.youtube.com/embed/nsuxoRkai7A" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe>: | |
http://joxi.ru/Dr8oRa3Iojy7dA. | |
Нижеследующий код нужно разместить в style.css активной темы | |
или, чтобы не вносить изменение в код темы (что будет хорошей идеей с точки зрения простоты установки возможных обновлений), | |
добавьте код в дополнительные стили: Админка → Внещний вид → Настроить → Дополнительные стили: http://joxi.ru/EA4aLdKfo5bd8r. |
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 | |
//Получить ID автора поста | |
$post_author_id = get_post_field( 'post_author', $post_id ); | |
//Или | |
$post_author_id = get_the_author_ID(); | |
//Получение ID автора поста на странице архива автора | |
if ( is_author() ) { | |
$author_id = get_query_var( 'author' ); | |
} |
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 add_hsts_header($headers) { | |
$headers['X-Robots-Tag'] = 'index, 123'; | |
return $headers; | |
} | |
add_filter('wp_headers', 'add_hsts_header'); | |
add_action( 'init', 'mnp_noindex_follow_rss' ); | |
function mnp_noindex_follow_rss() { | |
header( 'X-Robots-Tag: index, follow', 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
&::-webkit-input-placeholder | |
color: #59473E | |
&:-moz-placeholder | |
color: #59473E | |
&::-moz-placeholder | |
color: #59473E | |
&:-ms-input-placeholder |
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
Order deny,allow | |
deny from all | |
allow from XXX.XXX.XXX.XXX |