I have successfully changed the name of a specific page using this code in my functions.php file:
add_filter('pre_get_document_title', 'change_my_property_title');
function change_my_property_title($title) {
if ( is_page('property') ) {
return 'Property';
}
return $title;
}
My problem is I can't figure out how to change the name to an actual php variable that is on the property page. I am pulling property information from a json url and would like the address to be the title. If I try to point to the variable in my return statement nothing comes up.
Here is the page I'm working on: http://geekoutaustin.com/live/property/?id=d86967ad43c2f5271b02f94247ef858d&wpf28382_5=8252427