I'd like to show my latest blog post as a teaser on the front page of my personal website, in a div. Ideally it would even have a word limit -- maybe the first 100 words and then an ellipsis and link to the actual blog along with date and time. Add开发者_高级运维itional my blog is not attached on my website (so that I can't access it's database). My blog may be saved on like: blogspot.com etc..
I assume that everything is self-coded, so we don't have any abstractions or something. If you run a blog and a website there's probably some database or two. You'll seed to write SQL query that gets latest post from posts table and run it somewhere inside you website's code. If you have that data use field storing post's date, time and full text and extract 100 words [non trivial problem if you have HTML inside] and display them in a proper template file of your website.
精彩评论