I have a working WordPress site that contains a custom navigation and retrieves a page based on title. So what it looks like is, lets say I have a page called test
and the user selects test
on the custom navigation. The href
link that is placed would be #!test
. Now I am fully using Ajax
to call the content for test
and that looks like:
$.ajax({
url: "/thenewsite/wp-content/plugins/mass/return_body.php",
type: "post",
dataType: "json",
data:
{
'key_page' : key_page,
'function' : 'page_grab'
},
.....
});
return_body.php
:
$base = 'http://www.massmedicalstorage.com/thenewsite';
if ($fragment = $_GET['_escaped_fragment_']) {
$page = get_page_by_title($fragment);
print_r ($page);
exit;
}
$DBH = createConnection();
$response = array("status" => "ok", "code" => 1, "original_request" => $_POST); // CREATE REQUEST
if($_POST['function'] == 'page_grab')
{
$page = get_page_by_title($_POST['key_page']);
$response['data_retrieved'] = $page;
if($page !== null)
$response['status'] = "found";
}
Now the Ajax
function than places the content retrieved based on design requested.
So the area that is gray for me is, am I working with Google
correctly for SEO
ajax
purposes? Am I returning my content correctly in the _escaped_fragment_
section? Also how do I check to see if google is fetching the ajax
content? If I am not properly retrieving a snapshot
of my html
how do I do so correctly?
_escaped_fragment_
format. – eyoung100 Sep 9 '14 at 19:03