/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Function to display list of latest news articles function latest_news_list($count) { ?> <h3>latest news</h3> <ul> <?php global $post; $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <!-- <p class="date"><?php the_date(); ?></p> --> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> <?php } ?>