Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Does anyone know how to make new posts automatically show up in the frontpage, with out having to refresh the page. I have a wordpress site with multiple authors and want their new posts to show up automatically.

Thanks.

share|improve this question
    
I'm sorry, but I don't understand your Q. When you visit your site and get onto the index page, you'll have all new posts freshly fetched from the DB. No need to do some AJAX refresh... –  kaiser Jun 8 '11 at 10:16
3  
@kaiser My guess is that he wants new posts to show up when someone is already viewing the home page. –  anu Jun 8 '11 at 10:36
    
Yeahs anu ... I said, I want ajax to update the frontpage with new posts every so seconds, as there viewing the frontpage, as im using wordpress as a cms with many users that will make posts. –  Sirwan Qutbi Jul 9 '11 at 20:11
    
Please show us the code you got so far. Any scripts registered/enqueued/localized? –  kaiser Jun 17 '12 at 1:54
add comment

2 Answers

I cannot find a plugin that does this (although the Live Blogging Plugin is similar to what you need).

In general you should use the Periodic Refresh ajax pattern to check the server every few seconds if the content of the current dom is the latest posts. If not, insert in the content of the latest post(s). Good Luck!

share|improve this answer
add comment

In my (limited) programming world, I found Ajax long polling to be the easiest way of doing live updates.

Here is a basic example of it: http://stackoverflow.com/questions/333664/simple-long-polling-example-code

Other way would be to use HTML5 Websockets (but it needs special server setup): http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.