0

I'm trying to implement some AJAX to my theme, but there are a few things I cannot get my head (or Google) around.

I have a custom post type named "Faculty" and a page displaying the featured image for each entry in the custom post type in a grid that links to /faculty/entry1, /faculty/entry2 etc.

Instead of loading a new page with the content I'm trying to load the content above the grid using the admin-ajax.php file.

But how can I implement this leveraging the current "pretty" permalinks?

What I would like to achieve is that the user clicks the featured image and the url will change to /faculty/item2 and I will receive the content for item2 via AJAX. And if the user manually enters /faculty/item2 in the browser the same faculty page will load with the content from item2.

I really hope the explanation makes sense - and that somebody can give me a pointer in the right direction.

EDIT: This is an example of the functionality I'm looking for, just with the WordPress permalinks implemented: http://themewich.com/aware/

1 Answer 1

0

You can do that with html5 history API with which you can change the URL at the address bar whenever you want. Works on anything modern which is not IE, but maybe this utility will help with IE.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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