Opened 18 years ago
Closed 18 years ago
#3876 closed enhancement (wontfix)
New template tag - get_latest_post
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | lowest | |
| Severity: | trivial | Version: | |
| Component: | Template | Keywords: | |
| Focuses: | Cc: |
Description
Greets:
Just a quick mention that I would like to see the template tag get_latest_post. This would generate a link directly to the latest post. I'm thinking it woul be used in such places as a static front page.
Thanks,
-drmike
Change History (2)
Note: See
TracTickets for help on using
tickets.
This should probably not be in the core when it's so easy to simply stick into a plugin or a theme or a page template or what have you.
<?php function get_latest_post_permalink() { $my_query = new WP_Query('showposts=1'); if ($my_query->have_posts()) { $latest_post = $my_query->next_post(); return get_permalink($latest_post->ID); } } ?>