AnsPress_Dashboard::anspress_feed()
Description #
AnsPress feed.
Source #
File: admin/views/dashboard.php
public static function anspress_feed() {
$rss = fetch_feed( 'https://anspress.io/feed/' );
set_transient( 'anspress_feed', $rss );
?>
<div class="anspress_feed">
<?php
if ( ! $rss->get_item_quantity() ) {
echo '<p>'.__( 'Apparently, there are no updates to show!','anspress-question-answer' ).'</p>';
$rss->__destruct();
unset($rss );
return;
}
?>
<ul class="post-list">
<?php foreach ( $rss->get_items(0, 5 ) as $item ) : ?>
<li>
<a target="_blank" href="<?php echo esc_url( strip_tags( $item->get_link() ) ); ?>"><?php echo esc_html( $item->get_title() ); ?></a> -
<span class="posted"><?php echo $item->get_date('j F Y | g:i a' ); ?></span>
</li>
<?php endforeach; ?>
</ul>
<?php
$rss->__destruct();
unset($rss );
?>
</div>
<?php
}
Expand full source code Collapse full source code View on GitHub: admin/views/dashboard.php:291
Add your comment