Stiofan O'Connor
Forum Replies Created
-
AuthorPosts
-
Any way that can be moved one spot over so it’s with the other social media links? Currently, it appears at the first link.
It makes it a lot more complicated but…
add_filter('sd_details_output_social','_my_extra_social_details',10); function _my_extra_social_details($output){ global $post; if(isset($post->geodir_instagram) && $post->geodir_instagram){ if (strpos($output, 'fa-external-link-square') !== false) { $output = str_replace('fa-external-link-square"></i></a>','fa-external-link-square"></i></a><a rel="nofollow" target="_blank" href="' . esc_url($post->geodir_instagram) . '"><i class="fa fa-instagram"></i></a>',$output); }elseif (strpos($output, 'fa-facebook-official') !== false) { $output = str_replace('fa-external-link-square"></i></a>','fa-facebook-official"></i></a><a rel="nofollow" target="_blank" href="' . esc_url($post->geodir_instagram) . '"><i class="fa fa-instagram"></i></a>',$output); }elseif (strpos($output, 'fa-twitter-square') !== false) { $output = str_replace('fa-external-link-square"></i></a>','fa-twitter-square"></i></a><a rel="nofollow" target="_blank" href="' . esc_url($post->geodir_instagram) . '"><i class="fa fa-instagram"></i></a>',$output); }else{ $output = str_replace('<div class="sd-contacts">','<div class="sd-contacts"><a rel="nofollow" target="_blank" href="' . esc_url($post->geodir_instagram) . '"><i class="fa fa-instagram"></i></a>',$output); } // replace some icons $output = str_replace('fa-facebook-official','fa-wordpress',$output); } return $output; }Stiofan
Basically you just dont want them changing the region/city manually? If so then should it not work like that already if you hide them? The GPS info will not be filled in unless they select the google address or they drag the map.
Stiofan
I can’t think of a super easy way to do this. If you can explain the idea more maybe i can think of something? Is it just addresses you are worried about?
Stiofan
Great! thanks for letting us know 🙂
That link leads to “The link you followed may have expired, or the page may only be visible to an audience you’re not in.”
Stiofan
you can check for user translations here : https://wpgeodirectory.com/translate/projects
Stiofan
They have settings to disable it for a certain CPT https://theme-fusion.com/fb-doc/technical/fusion-builder-custom-post-types/ it does not seem to be working.
Stiofan
from the error message it is at about 135mb
Its not working, you may need to contact the author of the buidler plugin to ask why its running on a CPT its disabled on.Thanks,
Stiofan
I’ll mark this resolve but please realise its the wrong way and to change it ASAP.
Stiofan
If you edit that post in the backend you will see something is adding a “Head & Footer Code” section, this is for code not text 🙂 remove the text there and all will be good.
Thanks,
Stiofan
OK thanks, the error output is
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 22200 bytes) in /public_html/wp-content/uploads/fusion-builder-avada-pages/veterinarian.php on line 574The fusion builder is disabled on that CPT so it should not even be running there.
I would guess increasing the PHP memory limit to 256mb would fix this in the short term but you should really ask the author of that plugin why its running on a CPT its disabled on.
Thanks,
Stiofan
Where did u send it? What is the ftp host url?
It seems to be a problem related to fusion builder even though it is disabled for that CPT.
If you provide FTP info i will double check.
Stiofan
OK thanks,
Not tested but something like this should do what you want.
add_action(‘geodir_add_listing_geocode_js_vars’,’_my_region_name_changes’,20);
function _my_region_name_changes(){ echo "if(getState=='Edinburgh'){getState = 'Edinburgh & Lothians';}"; }I would recommend adding the “code snippets” plugin to add the code, if you have any problems you can provide wp-admin details in a private reply (only staff can see) and i will take a look.
You would also have to manually change the default location region to the exact text, the & might cause problems, if it does you might have to use “and” or a dash or slash.
Thanks,
Stiofan
Looks like we both misread the question 🙁
If you named your custom field html “instagram” then this code will add it:
add_filter('sd_details_output_social','_my_extra_social_details',10); function _my_extra_social_details($output){ global $post; if(isset($post->geodir_instagram) && $post->geodir_instagram){ $output = str_replace('<div class="sd-contacts">','<div class="sd-contacts"><a rel="nofollow" target="_blank" href="' . esc_url($post->geodir_instagram) . '"><i class="fa fa-instagram"></i></a>',$output); } return $output; }Thanks,
Stiofan
-
AuthorPosts