Pjax with wordpress custom theme giving 301 error in firebug

梦想的初衷 提交于 2020-01-06 03:29:08

问题


I am trying to use pjax in wordpress . but whenever I try to click the link which fetches the content via ajax call , nothing happens and page loads normally, firebug console show 301 aborted error . Any one can help ?


回答1:


if you are using ajax in wordpress then make the action in function.php file of your theam , like below example

add_action('wp_ajax_do_ajax', 'our_ajax_function');
function our_ajax_function(){
     // now we'll write what the server should do with our request here
}

Hope it will Help :)



来源:https://stackoverflow.com/questions/11134915/pjax-with-wordpress-custom-theme-giving-301-error-in-firebug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!