2019-03-05, 16:40:13
@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:
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>";
}
Check out my website: JohnStray.com