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 no_link_current_page($menu) { | |
return preg_replace('%((current-menu-item)[^<]+)[^>]+>([^<]+)</a>%', '$1<span class="current">$3</span>', $menu); | |
} | |
add_filter('wp_nav_menu', 'no_link_current_page'); |
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 | |
//Подключение | |
# carbon-fields plugin | |
add_action('after_setup_theme', 'crb_load'); | |
function crb_load() { | |
require_once( 'inc/carbon-fields/vendor/autoload.php' ); | |
\Carbon_Fields\Carbon_Fields::boot(); | |
} | |
# carbon-fields my fields | |
add_action('carbon_fields_register_fields', 'crb_register_custom_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 | |
$args = array( | |
'posts_per_page' => 5, | |
'cat' => "$rz_loan_card, $rz_loan_cash", | |
'meta_query' => array( | |
array( | |
'key' => '_rz_loan_fields|rz_loan_max_summ|0|0|value', | |
'value' => $summ, | |
'type'=> 'numeric', | |
'compare' => '>=', |
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
.diet-box.loading { | |
position: relative; | |
z-index: 1; | |
} | |
.diet-box.loading:before { | |
content: ''; | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; |
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 | |
/* | |
* Template name: Мой Супер-шаблон | |
* Template post type: post, page | |
*/ | |
?> |
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
if ( isset($_GET['select_diet']) ) $select_diet = $_GET['select_diet']; |
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 | |
$get_cat_ids_not_parce = explode(',', $get_cat_ids_not_parce); | |
$get_cat_ids_not_parce = array_map('trim', $get_cat_ids_not_parce); | |
// Если значения должны быть только целами числами | |
foreach ($get_cat_ids_not_parce as $index => $value) { | |
$get_cat_ids_not_parce[$index] = (int)$value; | |
} | |
$get_cat_ids_not_parce = array_diff($get_cat_ids_not_parce, array(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
-------С www на не-www------- | |
RewriteEngine On | |
RewriteCond %{HTTPS} !=on | |
RewriteCond %{HTTP_HOST} ^www.sdelaysite\.com$ [NC] | |
RewriteRule ^(.*)$ https://sdelaysite.com/$1 [R=301,L] | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.*)$ https://sdelaysite.com/$1 [R=301,L] |
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
User-agent: Yandex | |
Disallow: /wp-admin | |
Disallow: /wp-includes | |
Allow: /wp-includes/js/* | |
Disallow: /wp-login.php | |
Disallow: /wp-register.php | |
Disallow: /xmlrpc.php | |
Disallow: *?s* | |
Disallow: *?preview=true* | |
Disallow: */trackback/ |
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 | |
//Информация о рубрике поста: | |
$post_categorys_info = get_the_category(); | |
$first_cat_post_id = $post_categorys_info[0]->cat_ID; | |
?> | |
<div class="reviews-item__rating"><a href="<?= get_category_link($first_cat_post_id) ?>"><?= get_cat_name($first_cat_post_id) ?></a></div> | |
<?php | |
//Вывод подрубрик на странице рубрики | |
$current_cat_id = get_query_var('cat'); | |
OlderNewer