get the rss feed from bbpress by adding “rss” to the forum url
http://www.domain.com/bbpress/rss
copy the rss feed url and paste it on the rss/feed widget in wordpress
Sorry i meant on a template like on homepage.
you can use rss widgets on the homepage… if you mean “hardcoding it” to the template use the following code:
<?php if(function_exists(‘fetch_feed’)) {
include_once(ABSPATH.WPINC.’/feed.php’);
$feed = fetch_feed(‘http://www.domain.com/bbpress/rss’);
$limit = $feed->get_item_quantity(7); // specify number of items
$items = $feed->get_items(0, $limit); // create an array of items
}
if ($limit == 0) echo ‘<div>The feed is either empty or unavailable.</div>’;
else foreach ($items as $item) : ?>
<div>
get_permalink(); ?>”
title=”<?php echo $item->get_date(‘j F Y @ g:i a’); ?>”>
<?php echo $item->get_title(); ?>
</div>
<div>
<?php echo substr($item->get_description(), 0, 200); ?>
<span>[…]</span>
</div>
<?php endforeach; ?>
and edit the following:
$feed = fetch_feed(‘http://www.domain.com/bbpress/rss’);
$limit = $feed->get_item_quantity(7); // specify number of items
<?php echo substr($item->get_description(), 0, 200); ?>
Thank you for the suggestion.
With that code i get this:
title
first 10 words
i want to have this:
title
first 10 words
So there is too much spacing.