Ash Whitney
Forum Replies Created
-
AuthorPosts
-
SOLVED: I removed the “” from the shortcode. So for example: [uam_ad id=19117]
Not: [uam_ad id=”19117″]
And had this in the functions file:
add_filter( ‘geodir_location_description’, ‘shortcode_unautop’);
add_filter(‘geodir_location_description’, ‘do_shortcode’, 15);Okay just so everyone knows it seems the above method works (Thanks Guust). But the above method seems to set ‘data id’ to -1 (not the value the shortcode wants like 19117 or something). Does anyone know why this would happen,
Unfortunately it still doesn’t want to do it. How strange hmm.
Just so people can see what I done.
Hmm I can’t seem to get that working, but thank you Guust you’re the best.
Such a big shame about the shortcodes, someone should definitely look into this. Thanks Guust.
Here is a screenshot 🙂
When someone figures this out please let me know. FOr example when I search Birmingham or Manchester (I have listings in these places), they don’t appear in the results but they do on my map.
I get the same thing…
Hello Kor Chung
Thank you kindly for your time and assisitance as it’s most appreciated. The code you posted works perfectly.
For anyone looking to add a city and postcode to the map bubble, this is what I did (I’m not an experienced coder, but it works ok for me).
I slightly modified the code that Kor Chung kindly provided, then added it to my functions.php file.
Specifically, I replaced:
$address = str_replace($srcharr, $replarr, htmlentities(geodir_get_post_meta($ID, 'post_address', true), ENT_COMPAT, 'UTF-8')); // fix by Stiofan
With:
$address = str_replace($srcharr, $replarr, htmlentities(geodir_get_post_meta($ID, 'post_address', true), ENT_COMPAT, 'UTF-8')); // fix by Stiofan $address_city = str_replace($srcharr, $replarr, htmlentities(geodir_get_post_meta($ID, 'post_city', true), ENT_COMPAT, 'UTF-8')); $address_zip = str_replace($srcharr, $replarr, htmlentities(geodir_get_post_meta($ID, 'post_zip', true), ENT_COMPAT, 'UTF-8'));
And replaced:
<span class="geodir_address"><i class="fa fa-home"></i> <?php echo $address; ?></span>
With:
<span class="geodir_address"><i class="fa fa-home"></i> <?php echo $address . ", " . $address_city . ", " . $address_zip; ?></span>
Regards
Ash
-
AuthorPosts