filter rss

This commit is contained in:
2021-12-28 21:37:04 +03:00
parent 38e04b4d94
commit 5b279f70e6
4 changed files with 14 additions and 9 deletions

View File

@@ -108,7 +108,7 @@
</div><!-- end main --> </div><!-- end main -->
<footer>
<?if (LANG_VERSION == 'ru'):?> <?if (LANG_VERSION == 'ru'):?>
@@ -143,8 +143,6 @@
<footer>
<div id="footer_menu"> <div id="footer_menu">
<?php wp_footer(); ?> <?php wp_footer(); ?>

View File

@@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?></title> <title><?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?></title>
<link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=134"> <link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=135">
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet"> <link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/jquery-3.6.0.min.js"></script> <script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/jquery-3.6.0.min.js"></script>
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/golos.js"></script> <script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/golos.js"></script>
@@ -63,4 +63,3 @@
<!--<div>Главное</div>--> <!--<div>Главное</div>-->
</div> </div>

View File

@@ -4,10 +4,18 @@
include_once '/vhosts/beta/wp-load.php'; include_once '/vhosts/beta/wp-load.php';
function filterHtml($html) {
$html = trim($html);
$html = preg_replace('/(\>)\s*(\<)/m', '$1$2', $html);
return preg_replace('/<!--(.*?)-->/', '', $html);
}
date_default_timezone_set('Europe/Moscow'); date_default_timezone_set('Europe/Moscow');
$posts = get_posts( array( $posts = get_posts( array(
'numberposts' => 20, 'numberposts' => 25,
'category' => 2, 'category' => 2,
'orderby' => 'date', 'orderby' => 'date',
'order' => 'DESC', 'order' => 'DESC',

View File

@@ -20,7 +20,7 @@
<?endif?> <?endif?>
<pubDate><?=_U2RFC822($post->post_date)?></pubDate> <pubDate><?=_U2RFC822($post->post_date)?></pubDate>
<yandex:full-text><![CDATA[ <yandex:full-text><![CDATA[
<?=trim($post->post_content)?> <?=filterHtml($post->post_content)?>
]]> ]]>
</yandex:full-text> </yandex:full-text>
</item> </item>