How to make the WordPress admin-bar work with AJAX loading

I’m working on a website that uses html5’s push- and popstate in combination with ajax-calls to create a website that dynamically loads in WordPress posts and pages, without causing a page refresh.

I’ve got that working fine, but I would love it if the black WordPress toolbar/adminbar that shows at the top of the site when you’re logged in as an admin, also reflected the change of content. Is there any way at all to make this happen? So that when I go from a post to page, for example, the “edit” link in the admin bar updates.

Read More

I don’t think it’s as easy as I hope it is, and if it can’t be worked out I think I’ll just disable the adminbar on the front-end. But it could be that I’m missing something.

Thanks in advance!

Related posts

Leave a Reply

1 comment

  1. I’m working on this myself. I’m gonna build an ajax action and jquery function to do this. I will post here when it’s done. For NOW i’ve instructed my users to just refresh to get the edit link. if you’re using HTML5 history then you’re on the permalink you want anyways. refresh and let the server regenerate the bar. not perfect but not terrible.

    another option is to put edit post links in your template.