Hi,
this shuold work like this, if there is a website URL in the listing, it will redirect to it, if tere isn’t it will direct to the listing details page normally.
unction my_change_bubble_title($html, $postinfo_obj, $post_preview){
$srcharr = array("'", "/", "-", '"', '\');
$replarr = array("′", "⁄", "–", "“", '');
if (isset($postinfo_obj->geodir_website) && $postinfo_obj->geodir_website) {
$ID = $postinfo_obj->post_id;
$plink = get_permalink($ID);
$title = str_replace($srcharr, $replarr, htmlentities($postinfo_obj->post_title, ENT_COMPAT, 'UTF-8'));
$link = '<a href="'.$plink.'">'.$title.'</a>';
$website_link = esc_url($postinfo_obj->geodir_website);
$title_link = '<a href="'.$website_link.'">'.$title.'</a>';
$html = str_replace($link,$title_link,$html);
}
return $html;
}
add_filter('geodir_custom_infowindow_html','my_change_bubble_title',10,3);
Let us know how you went,
Thanks