Is there a url(with or without GET parameter) for wordpress most recent post?
I'm frequently checking a blog for the most开发者_StackOverflow中文版 recent news, and I hate always going to the homepage for the most recent post, sometimes because of the cache stuff the most recent post won't display on the homepage for 10 minutes or so.
So if I want to get the most recent post as soon as the post is published, is there a direct link for the most recent post? Maybe like http://exampleblog.com/?p=most_recent ?
Well I've tried several ways like RSS feeds, nothing works. Anybody knows how to do this?
Thanks
There are a few plugins that can do this or you will have to code a page to do it. There is no prebuilt page or url. One plugin is "Recent Posts 2.6.2.0" (many more like it) and it is for wordpress and can be viewed by going to something like yourblog.com/recent-posts. Or if you prefer to hand code a solution a good guide can be found by going to http://keirwhitaker.com/archive/wordpress-get-latest-post-url-function/
EDIT
Code to retrieve blog posts from rss. PHP code I have used and can modify the code just to get one post
<?
include("rssreader.php");
$url="http://www.blog.com/feed/";
$rss=new rssFeed($url);
if($rss->error){
print "<h1>Error:</h1>\n<p><strong>$rss->error</strong></p>";
}else{
$rss->parse();
#$rss->showHeading("h1");
#if($rss->link){
# print "<p>Provided courtesy of:<br>\n";
# print "<a href=\"$rss->link\">$rss->link</a>\n";
#}
#$rss->image->show("middle");
#$rss->showDescription();
$rss->showStories();
}
?>
and the rssreader can be downloaded at http://apptools.com/phptools/downloads/rssreader.zip
精彩评论