Tagged: 

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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/

    #721118

    Hey 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,
    Yigit

    #762275

    Taken 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

    #764028

    Hi,

    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,
    Ismael

    #764073

    In 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

    #764552

    Hey!

    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,
    Ismael

    #764897

    Very 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 :)

    #765911

    Hi!

    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,
    Ismael

    #814061

    Once 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

    #816131

    Hi,

    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,
    Ismael

    #816506

    Perfect 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.

    #816603

    Hi,

    Glad it is working. We’ll report this feature to Kriesi.

    Best regards,
    Ismael

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Mobile View link to facebook app’ is closed to new replies.