Hot answers tagged

1

Here, the code operates on anything that matches the #searchButton element: jQuery("#searchButton") If there is a searchButton on other pages, it will match it, soo you need to be more specific. For example, on the homepage, the <body> tag will have the home class, here is my sites homepage body tag: <body class="home blog logged-in ...


1

There's only one reason you get a 400 error with admin-ajax.php: The wp_ajax_{$action} or wp_ajax_nopriv_{$action} action has not been hooked with an {$action} that matches the action data parameter sent with your request. So either your callback is not hooked, or you're not sending the action correctly. Your code is making both errors. You are encoding the ...


1

Here is your problem: blogcontent.php When WP is contacted to handle the Admin AJAX request, it doesn't load a page template. Remember, every request to WP loads WP from a blank slate. It doesn't know anything about the previous requests, only what it's told. So because you aren't requesting that page, the template never loads, the filters never run, so ...


Only top voted, non community-wiki answers of a minimum length are eligible