Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use wordpress functions in an ajax call

I wanted to know if there is a way to use function like query_post() in an ajax call ?

Let's say i'm calling the file _inc/ajax.php

I want to be abble to use the wordpress functions, but i don't know why. Can someone help me for that ?

Thanks a lot :)

like image 839
Thoma Biguères Avatar asked May 29 '12 22:05

Thoma Biguères


1 Answers

I highly recommend the JSON API plugin: http://wordpress.org/extend/plugins/json-api/. It provides a RESTful interface for the most common WordPress functions including query_post and allows you to add your own actions.

like image 150
calebds Avatar answered Oct 23 '22 09:10

calebds