function add_to_rss($query) {
if (is_admin()) {
return $query;
}
$include = array();
if ( $query->is_main_query() && is_feed() ) {
$posts = get_posts(array(
'post_type' => 'post',
'meta_query' => array(
array(
'key' => 'добавить_в_rss',
'value' => '1',
'compare' => '=',
),
),
));
foreach($posts as $post) {
$include[] = $post->ID;
}
$query->set('post__in', $include);
}
return $query;
}
add_filter( 'pre_get_posts', 'add_to_rss' );
<?php
wp_register_style('fonts', 'https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700&subset=cyrillic', false, null);
wp_enqueue_style('fonts');
?>