开发者

Is there a url(with or without GET parameter) for wordpress most recent post?

开发者 https://www.devze.com 2023-03-31 23:21 出处:网络
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 rece

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

0

精彩评论

暂无评论...
验证码 换一张
取 消