2021-12-19, 00:01:14
(2019-03-05, 16:40:13)johnstray2001 Wrote: @Lazy-Crocodile: This can be archived using the function `return_blog_category('categoryname');`. This will return an array of posts from the given category that you can then loop over and display the posts how you wish.
For example:
PHP Code:foreach ( return_blog_category( 'Category Name' ) as $slug => $filename ) {
$post = getXML( $filename );
$title = (string) $post->title;
$author = (string) $post->author;
$date = stringtotime($post->date);
$content = html_entity_decode( $post->content );
// Want to limit to a specific date range?
// Check if this post falls within the date range using UNIX timestamps.
if ( $date > 1546300800 || $date < 1548979199 ) { # Jan 1, 2019 to Jan 31, 2019
echo "<li>" . $title . "<li>";
}
// If filtering by date above, remove the following line
echo "<li>" . $title . "</li>";
}
hi i dont know if you are still using this plugin but i have a issue with is plugin i want to display posts from selected category on a page for that i am using <?php show_blog_category($category=mycat, $echo=true, );?> it is working and is showing all posts from that (mycat) category what i need is to limit the number of posts to 3, 2, 5 or by any number can you help or anyone please