Hello,
I want to display locality in a div inside the listing image. Please see screenshot of objective.
I’ve managed to insert a div (absulte relative to .geodir-post-img thorough Jquery
var $newDiv = jQuery("<div/>") // creates a div element
.addClass("comunalisting") // add a class
.html("<span>City Name</span>");
jQuery(".geodir-post-img").append($newDiv);
The problem is locality is a php variable.
Is it possible to add this?
perhaps if I knew the code to the specific locality I could move forward.
For address is
global $wp_query;
$postid = $wp_query->post->ID; // retrieve the ID
$address= geodir_get_post_meta($postid,'post_address',true);
echo $address;
but I don’t know just to show the locality
If there’s a better way it would be great.
Thank you