Tagged: facebook
-
AuthorPosts
-
December 2, 2016 at 4:40 pm #719793
When viewing the enfold theme on a mobile the link to facebook is to the normal webversion that then prompts for a login. There is a different url for the mobile app and a business page and am wondering if, by using media query a different facebook url could be shown for mobile view so that the facebook app opens instead.
a url to open the mobile app on a phone starts with fb://profile/profilenumberhere an example mobile site with this on is http://oxfordspires.co.uk/mobile/
December 6, 2016 at 4:24 pm #721118Hey madmanbean,
Please try adding following code to Functions.php file in Appearance > Editor
function avia_change_fb_link(){ if(wp_is_mobile() ) ?> <script> jQuery(window).load(function(){ jQuery('#top #wrap_all .av-social-link-facebook a').attr('href','NEW LINK HERE'); }); </script> <?php } } add_action('wp_footer', 'avia_change_fb_link');
Best regards,
YigitMarch 16, 2017 at 11:45 pm #762275Taken a long time to getting round to trying this but your suggested edit to functions.php only resulted in totally breaking the website and took a while to recover as even restoring the original php file did not fix it!!!!! Surely this should be a css issue. If people select the facebook link when using a mobile rather than a bigger screen pc they should be shown a different link that directs them to the mobile app url. I can do this with a normal website using media queries but have no idea how this can be done using a wordpress enfold website. This is quite an important feature that is missing as so many people view using a website yet are being directed to the desktop facebook login rather than a link to the facebook app which starts fb://profile/profilenumber rather than https://facebook/username.
Below is an example of how I achieved this on a html website..
<div class=”widget widget-social”>
<div class=”social-media”> <i class=”fa fa-facebook”></i>
<div class=”social-media”> <i class=”fa fa-facebook”></i>css media query used bootstrap css as per these few lines
@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px)and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px)and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important
March 21, 2017 at 6:57 am #764028Hi,
Thank you for the update. It’s been a while.
Please post the code on pastebin.com or use the following filter:
function ava_custom_script_fix(){ ?> <script> (function($){ var a = function() { var isMobile = ''; if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && 'ontouchstart' in document.documentElement) { isMobile = true; } else { isMobile = false; } if(isMobile || $(window).width() <= 767) { $('#top #wrap_all .av-social-link-facebook a').attr('href','fb://profile/212971392077465'); } else { $('#top #wrap_all .av-social-link-facebook a').attr('href', 'http://facebook.com/kriesi'); } } $(window).resize(function() { a(); }).resize(); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_custom_script_fix');
Please copy this code directly from this forum, not from your email. And don’t forget to replace the facebook page url.
Best regards,
IsmaelMarch 21, 2017 at 9:25 am #764073In your reply you do not say to where to place this code!! Perhaps you can clarify?
The last time was to functions.php and in doing so the changes completely broke the website and required a complete restore as even using a backup version of functions.php would not recover the website?
Are you sure that this will not do the same thing?
As said before I am amazed that this feature has not been incorporated into the basic design
March 22, 2017 at 6:05 am #764552Hey!
Please add it in the functions.php file. And make sure that you copy the code directly from this forum, not from your email.
Regards,
IsmaelMarch 22, 2017 at 5:12 pm #764897Very concerned that the site does not crash again.
Am I to edit
Enfold: Theme Functions (functions.php) ?
Below is my current code and should this be added just to the end// PLEASE USE PASTEBIN FOR LONG CODES :)
March 24, 2017 at 6:28 am #765911Hi!
Yes, you should add it at the very bottom of the functions.php file. The site will not crash as long as you copy the code properly and there are no existing function with the same name or callback. If you can provide the login details, we’ll add it for you.
Best regards,
IsmaelJune 28, 2017 at 7:07 pm #814061Once again sorry for the delay.
I have created a new admin for you username Ismael and password enfoldsupport123!!
logon is http://www.little-india-didcot.co.uk/wp-admin
their facebook links are https://www.facebook.com/Little-India-Didcot-1184375088251044
and for mobile app fb://profile/1184375088251044
Appreciate you trying to add this to the functions.php page as if I can get this working I have about half a dozen other enfold sites I am working on that I want to add this to. I am just worried that this will cause problems again if I try to add this
July 4, 2017 at 4:20 am #816131Hi,
Thank you for the update.
We added the script in the functions.php file. Please remove browser cache or hard refresh before checking the page.
Best regards,
IsmaelJuly 4, 2017 at 9:48 pm #816506Perfect and thankyou. You really should incorporate this extra script into enfold as I see so many websites where the facebok link just prompts a login when trying to access facebook on a mobile. The different link to the mobile app when viewing froma mobile is something that every website should have.
July 5, 2017 at 5:27 am #816603 -
AuthorPosts
- The topic ‘Mobile View link to facebook app’ is closed to new replies.