2015-06-04, 02:45:30
(2015-06-04, 00:54:20)Carlos Wrote: Then you can use this code in your component or template:
Code:<?php
global $NMPAGEURL, $NMRECENTPOSTS;
if ($NMPAGEURL == '') return;
$posts = nm_get_posts();
if (!empty($posts)) {
echo '<ul class="nm_recent">',PHP_EOL;
$posts = array_slice($posts, 0, $NMRECENTPOSTS, true);
$posts = array_reverse($posts); // ascending date order
foreach ($posts as $post) {
$url = nm_get_url('post') . $post->slug;
$title = stripslashes($post->title);
echo ' <li><a href="',$url,'">',$title,'</a></li>',PHP_EOL;
}
echo '</ul>',PHP_EOL;
}
?>
It's a patched version of nm_list_recent(), for News Manager 2.2.x to 3.1
(I may add some option or function for this... In the meantime you can use that.)
Hi Carlos,
Absolutely Perfect!
Thanks so much for this fix. I worked great!!!