Files
vij/views/rss/rssnews.php
arlemp@selectel.ru 3727594359 new rss channel
2022-02-21 13:53:43 +03:00

35 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?echo '<?xml version="1.0" encoding="UTF-8"?>';?>
<rss version="2.0">
<channel>
<language>ru</language>
<copyright><?=date('Y')?>, Ветеринария и жизнь</copyright>
<title>Новости с сайта www.vetandlife.ru</title>
<link>https://www.vetandlife.ru</link>
<lastBuildDate><?=_U2RFC822(date('Y-m-d h:i:s'))?></lastBuildDate>
<description>Новости с сайта www.vetandlife.ru</description>
<image>
<url>https://vetandlife.ru/wp-content/themes/vij/pub/vij.png</url>
<title>Ветеринария и жизнь</title>
<link>https://www.vetandlife.ru</link>
</image>
<?foreach($posts as $post):?>
<item>
<title><?=htmlspecialchars($post->post_title)?></title>
<guid><?=get_permalink($post->ID);?></guid>
<description><?=htmlspecialchars($post->post_excerpt);?></description>
<?$category=get_the_category($post->ID);?>
<category><?=$category?></category>
<?$author = get_the_author($post->ID);?>
<?if (isset($author) and $author !== ''):?>
<author><?=$author?></author>
<?endif?>
<?if (has_post_thumbnail($post->ID)):?>
<enclosure url="<?=get_the_post_thumbnail_url($post->ID)?>" type="image/jpeg"/>
<?endif?>
<pubDate><?=_U2RFC822($post->post_date)?></pubDate>
<description><![CDATA[<?=strip_tags($post->post_content)?>]]></description>
</item>
<?endforeach?>
</channel>
</rss>