how use php query in AJAX jquery

You need to edit the PHP associated with the AJAX action call_post. If you want to return different data, you should pass a parameter in the request that you handle later; data:”action=call_post&template=custom&”+checked, Ideally, you could just return the data rendered from php with a flag data:”action=call_post&template=custom&format=html&”+checked, From a PHP perspective, you would find your parameters … Read more

Submitting custom post from frontend,jQuery ajax, and custom validation – can’t find proper place to insert wp_insert_post()

You can achieve the goal through many ways. though the way you have selected is not an appropriate one but you can go with it also. just include the file wp-blog-header.php file (placed at the wordpress root) into validation.php above all other code. you can find all the wordpress related functions will work like a … Read more

AJAX Returning Way Too Many Posts

OK, so I’m not sure if this is best practice, but after testing the code by using a onclick rather than scroll, the pages do load appropriately. I have got round the issue of loads of results by adding a condition to only return true after the AJAX has completed; // AJAX Posts var pageNumber=”0″; … Read more

AJAX save options inside class

Found the issue. First I added ini_set(‘log_errors’,TRUE); ini_set(‘error_reporting’, E_ALL); ini_set(‘error_log’, dirname(__FILE__) . ‘/error_log.txt’); along the define(‘WP_DEBUG’, TRUE); in my wp-config.php, this writes the errors, notices and warnings in the error_log.txt in the root folder (I don’t know why I haven’t thought of that in the first place). Then I saw the errors – I used … Read more