开发者

Loading both random and specific content in WordPress with Ajax, sometimes changing the URL path

I have a site running on WordPress with a custom post type called "Video". By defaults in the front page displays a random video and when the video ends, the page is reloaded and it displays another random one. The URL remains intact, save obviously when one use a permalink for an specific video. I want to tweak the site to use Ajax, yet I'm not sure of how to acomplish it well:

  • By default, the main page should display a random video and when it ends or when one reload the page (via a link in the site itself), it displays开发者_JAVA技巧 another random one, yet with ajax. The URL on the navigator don't change.
  • When one clicks the permalink of a video (attached to each random video), the URL on the navigator has to change but the page remains the same and when the video ends, it just loops (much like how it works right now, but without reloading the whole page).


HTML5 History API with hashbang (#!) URLs fallback

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜