Hello, I have customized the address format in the sidebar on the listing details pages using the code below
function cutsom_gd_address_output($html, $variables_array) {
if (geodir_is_page('detail')) {
$html = str_replace('<br>', '', $html);
$html = str_replace('<span itemprop="streetAddress">', '<span class="businessName" style="display: block; clear: both;">' . get_the_title() . '</span><span itemprop="streetAddress">', $html);
$html = str_replace('<span itemprop="streetAddress">', '<span class="boxAddress" itemprop="streetAddress" style="clear: both; display: block;">', $html);
$html = str_replace('<span itemprop="addressRegion">', '<span class="boxAddress" itemprop="addressRegion" style="clear: both; display: inline-block"> ', $html);
$html = str_replace('<span itemprop="addressCountry">', '<span class="boxAddress" itemprop="addressCountry" style="display: none">', $html);
$html = str_replace('<span itemprop="postalCode">', '<span class="boxAddress" itemprop="postalCode"> ', $html);
}
return $html;
}
add_filter('geodir_show_post_address', 'cutsom_gd_address_output', 10, 2);
It is altered from the code provided here.
My problem is that the code is not pulling the city, though the city does display in the details sidebar. I need to add the boxAddress class to the city as well.
I see the above code isn’t pulling it individually (even though it displays on the frontend), therefore not allowing me to add the class, so how do I add that?
You can view the listing here.