This file contains hidden or 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 = [ | |
'posts_per_page' => -1, | |
'meta_query' => [ | |
[ | |
'key' => '_rz_loan_fields|rz_loan_max_summ|0|0|value', | |
'value' => (int) $_GET['summ'], // это что я ввел в форме фильтра (что я ввел) - это значение будет сравниваться с значением поля так (значение поля) >= (что я ввел) | |
'type'=> 'numeric', | |
'compare' =>', |
This file contains hidden or 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 Popular_Morkovin_Widget extends WP_Widget { | |
function __construct() { | |
parent::__construct( | |
'popular_morkovin', | |
__( 'Популярные статьи', 'text_domain' ), | |
array('description' => __( 'Популярные статьи Морковина', 'text_domain' ), ) | |
); | |
} |
This file contains hidden or 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.php выводящий ссылки «к оглавлению» для h2 (кроме первой) | |
add_filter( 'the_content', 'add_link_to_toc', 100, 1 ); | |
function add_link_to_toc( $content ) { | |
$toc_container_position = strpos($content, 'toc_container'); | |
if ($toc_container_position) { | |
$h2_pos = array(); | |
$offset = 0; |
This file contains hidden or 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 | |
# получить комплексное поле записи | |
$rz_cards_fields = carbon_get_post_meta(get_the_ID(), 'rz_single_slider'); | |
# получить опцию темы | |
$home_title = carbon_get_theme_option('rz_page_home_title'); | |
use Carbon_Fields\Container; | |
use Carbon_Fields\Field; |
This file contains hidden or 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
/*-----Убираем показ лишней информации----------------------****/ | |
add_filter('login_errors', create_function('$a', "return null;")); | |
remove_action('wp_head', 'wp_generator'); | |
/** | |
* Закрытие страниц пагинации от индексирования | |
*/ | |
/*add_action( 'wpseo_head', 'art_noindex_paged', 0 ); | |
function art_noindex_paged() { |
This file contains hidden or 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 | |
/* Create a WordPress While Loop | |
-------------------------------------------------- */ | |
$wordpress_loop_argument = array( | |
'post_type' => 'custom_post_type', | |
'posts_per_page' => -1, | |
'orderby' => 'date', | |
'order' => 'ASC' | |
); |
This file contains hidden or 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 if ( has_post_thumbnail() ) :?> | |
<a href="<?php the_permalink() ?>" class="thumb"><?php the_post_thumbnail('thumbnail', array( | |
'alt' => trim(strip_tags( $post->post_title )), | |
'title' => trim(strip_tags( $post->post_title )), | |
)); ?></a> | |
<?php endif; ?> |
This file contains hidden or 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
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
This file contains hidden or 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 | |
/** | |
* Source https://gist.github.com/ms-studio/7108833 | |
* | |
* Rewriting the WordPress gallery shortcode | |
* | |
* Original WordPress code is located in : wp-includes/media/ | |
* | |
* Customizations: |
NewerOlder