2018-03-05, 13:13:38
Dear GS-Community,
I have a maybe simple question but couldn't figure it out of the "News manager" threads.
What I need is a customized output of the news-list, to wrap a surrounding div with custom CSS class, adding a "flex"-row etc.
Something like the
<?php nm_list_recent(); ?>
loop, but with the excerpt and image.
The original loop:
At the Moment I got this (works so far, is used as a component with "Dynpages"):
But I can't find out how to display the excerpt. I tried different lines of the "site.php" but all tests produced just blank fields.
It would be very helpful, if someone could add one (or more) example line(s).
Or does this need an extra function defined?
(I'm more into graphic-design, frontend-layout, CSS3 etc. and not so experienced in php)
Sorry for my rough english,
Best regards and many thanks!
(And many thanks for all the effort by the author to build the plugin)
I have a maybe simple question but couldn't figure it out of the "News manager" threads.
What I need is a customized output of the news-list, to wrap a surrounding div with custom CSS class, adding a "flex"-row etc.
Something like the
<?php nm_list_recent(); ?>
loop, but with the excerpt and image.
The original loop:
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;
}
?>
At the Moment I got this (works so far, is used as a component with "Dynpages"):
Code:
<?php
global $NMPAGEURL, $NMRECENTPOSTS;
if ($NMPAGEURL == '') return;
$posts = nm_get_posts();
if (!empty($posts)) {
echo '<div class="posts">',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);
$image = stripslashes($post->image);
echo ' <article>
<a href="',$url,'">',$title,'</a>
<span class="image object"><img src=" ',$image,' "> </span>
<br> <br>
<a href="',$url,'"><span class="more-link-style">weiterlesen ...</span></a>
</article>',PHP_EOL;
}
echo '</div class="posts">',PHP_EOL;
}
?>
But I can't find out how to display the excerpt. I tried different lines of the "site.php" but all tests produced just blank fields.
It would be very helpful, if someone could add one (or more) example line(s).
Or does this need an extra function defined?
(I'm more into graphic-design, frontend-layout, CSS3 etc. and not so experienced in php)
Sorry for my rough english,
Best regards and many thanks!
(And many thanks for all the effort by the author to build the plugin)