[wp-trac] Re: [WordPress Trac] #3876: New template tag -
get_latest_post
WordPress Trac
wp-trac at lists.automattic.com
Mon Feb 26 17:24:47 GMT 2007
#3876: New template tag - get_latest_post
-------------------------+--------------------------------------------------
Reporter: drmike | Owner: anonymous
Type: enhancement | Status: new
Priority: lowest | Milestone: 2.3
Component: Template | Version:
Severity: trivial | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Changes (by Otto42):
* priority: low => lowest
* component: Administration => Template
* severity: normal => trivial
Comment:
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);
} }
?>
}}}
--
Ticket URL: <http://trac.wordpress.org/ticket/3876#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list