Custom code not registering on mobile devices

This topic has 9 replies, 4 voices, and was last updated 1 years ago ago by Andrew Mitchell

  • Avatar: Grace
    Grace
    Participant
    November 17, 2024 at 16:15

    I tried to replace one of the mobile panel options with my currency switcher with custom code and it isn’t registering:

    Please, contact administrator
    for this information.
    Files is visible for topic creator and
    support staff only.
    8 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    November 17, 2024 at 16:47

    Hello, Grace,

    Thank you for reaching out to us.

    Please note that the area shown in your screenshot is designated exclusively for CSS code. Any other type of code will not function properly in that section. For code customization, we recommend making the necessary changes through the child theme files https://developer.wordpress.org/themes/advanced-topics/child-themes/ https://www.8theme.com/documentation/xstore/theme-installation/child-theme/

    Best regards,
    8Theme’s Team

    Avatar: Grace
    Grace
    Participant
    November 19, 2024 at 03:00

    This is the code I’ve inserted into the php and it still hasn’t taken effect on the mobile panel.

    Files is visible for topic creator and
    support staff only.
    Avatar: Justin
    Luca Rossi
    Support staff
    November 19, 2024 at 08:50

    Dear Grace,

    We hope this message finds you well.

    We have noticed that the currency switcher is currently positioned at the bottom of your website, as shown in this screenshot: [link](https://prnt.sc/WeF9OIm4OXne).

    If you would like the switcher to appear only on mobile devices, we recommend adding the wp_is_mobile() condition to your custom code. The updated code should look like this:

    
    add_action('wp_footer', 'add_currency_switcher_html');
    function add_currency_switcher_html(){
         if(wp_is_mobile()){
              /* Your HTML code will go here */
         }
    }
    

    We hope this solution is helpful. Should you need any further assistance, please don’t hesitate to reach out.

    Best regards,
    The 8Theme Team

    Avatar: Grace
    Grace
    Participant
    November 20, 2024 at 09:49

    Hi! When I tested the code out on Inspect, it appeared in the mobile panel correctly but in the php, it still shows up strangely: https://imgur.com/a/yFSmN2o

    Please contact administrator
    for this information.
    Avatar: Justin
    Luca Rossi
    Support staff
    November 20, 2024 at 14:07

    Hi @Grace,

    The custom code is working fine. Please note that the wp_is_mobile() condition returns to TRUE when you test your website on real mobile phone or simulator(phones) only:

    https://prnt.sc/vuJJLz2Dcjrn

    The currency switcher is at the bottom now but it’s hidden by the mobile panels. Please also add this custom CSS codes under XStore > Theme Options > Theme Custom CSS > Global CSS:

    
    body .woolentor-currency-switcher {
        position: fixed;
        bottom: 150px;
        z-index: 999999;
        width: 100%;
        background: #fff;
    }
    

    Hope it helps!

    Avatar: Grace
    Grace
    Participant
    November 20, 2024 at 16:49

    No, look at the pictures.

    https://imgur.com/a/yFSmN2o

    It’s not working the way it should. The first image it’s included in the mobile panel which is what I want. Now when I add the same code, it’s positioned at the bottom of the page instead of directly in the mobile panel.

    Please contact administrator
    for this information.
    Avatar: Justin
    Luca Rossi
    Support staff
    November 21, 2024 at 06:02

    Dear Grace,

    We regret to inform you that there is currently no hook available to integrate the currency switcher within the mobile panels. Implementing this feature would require extensive customization, which falls outside the scope of the standard support services we provide.

    If you are interested in pursuing a personalized customization, we kindly encourage you to submit a request through our customization panel, which can be accessed via the following link: https://www.8theme.com/account/#etheme_customization_panel. This platform will enable you to collaborate directly with our technical team to explore the possibilities.

    Please note that customization services may involve additional charges. The exact cost will be determined after a detailed review of your specific requirements.

    We appreciate your understanding and are here to assist you further should you have any questions or need additional support.

    Best regards,
    The 8Theme Team.

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    December 7, 2024 at 15:37

    Dear Grace,

    We trust our theme is enhancing your experience. Taking a brief moment to rate it with a glowing 5 stars on ThemeForest would be immensely appreciated. Your feedback holds significant value for us.

    Click here to rate now: https://themeforest.net/downloads

    Thank you sincerely for your ongoing support!

    Best Regards,
    The 8Theme Team

  • Viewing 9 results - 1 through 9 (of 9 total)

The issue related to '‘Custom code not registering on mobile devices’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.