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
#loader { | |
background: none repeat scroll 0 0 #ffffff; | |
bottom: 0; | |
height: 100%; | |
left: 0; | |
position: fixed; | |
right: 0; | |
top: 0; | |
width: 100%; | |
z-index: 9999; |
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 можно исключить ВСЕ страницы. | |
Под ‘страницами’ здесь я подразумеваю одноименный тип контента. | |
<?php | |
function bez_stranic_v_poiske($zapros) { | |
if ($zapros->is_search) : | |
$zapros->set('post_type', 'post'); | |
endif; |
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 no_more_jumping($post) { | |
return '<a href="'.get_permalink($post->ID).'" class="read-more">'.'Читать далее »'.'</a>'; | |
} | |
add_filter('the_content_more_link', 'no_more_jumping'); |
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 | |
class comment_walker extends Walker_Comment { | |
var $tree_type = 'comment'; | |
var $db_fields = array( 'parent' => 'comment_parent', 'id' => 'comment_ID' ); | |
// constructor – wrapper for the comments list | |
function __construct() { ?> | |
<section class="comments-list"> |
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 | |
function remove_comment_fields($fields) { | |
unset($fields['url']); | |
return $fields; | |
} | |
add_filter('comment_form_default_fields', 'remove_comment_fields'); | |
?> |
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 wp_nav_menu(array( | |
'menu' => 'Menu', // (string) Название выводимого меню (указывается в админке при создании меню, приоритетнее | |
// чем указанное местоположение theme_location - если указано, то параметр theme_location игнорируется) | |
'container' => 'div', // (string) Контейнер меню. Обворачиватель ul. Указывается тег контейнера (по умолчанию в тег div) | |
'container_class' => '', // (string) class контейнера (div тега) | |
'container_id' => '', // (string) id контейнера (div тега) | |
'menu_class' => 'sf-menu', // (string) class самого меню (ul тега) | |
'menu_id' => '', // (string) id самого меню (ul тега) | |
'echo' => true, // (boolean) Выводить на экран или возвращать для обработки | |
'fallback_cb' => 'wp_page_menu', // (string) Используемая (резервная) функция, если меню не существуе |
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 plural_form($number, $after) | |
{ | |
$cases = array(2, 0, 1, 1, 1, 2); | |
echo $number . ' ' . $after[($number % 100 > 4 && $number % 100 < 20) ? 2 : $cases[min($number % 10, 5)]]; | |
} |
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
// Delete anchor from Read more tag | |
function no_more_jumping($post) | |
{ | |
return '<a href="' . get_permalink($post->ID) . '" class="read-more">' . 'Read more »' . '</a>'; | |
} | |
add_filter('the_content_more_link', 'no_more_jumping'); |
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
//Проверка | |
/* | |
* <!--noindex--> <center><?php print get_num_queries(). ' - столько SQL запросов к базе.<br />'. timer_stop(0, 6). ' - за столько сгенерировалась страница.'; ?></center> <!--/noindex--> | |
* */ |
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
//Woocommerce OneSALE customize text | |
add_filter('woocommerce_sale_flash', 'my_custom_sale_flash', 10, 3); | |
function my_custom_sale_flash($text, $post, $_product) | |
{ | |
return '<span class="onsale">Your text here</span>'; | |
} |
OlderNewer