I tried to replace one of the mobile panel options with my currency switcher with custom code and it isn’t registering:
This topic has 9 replies, 4 voices, and was last updated 1 years ago ago by Andrew Mitchell
I tried to replace one of the mobile panel options with my currency switcher with custom code and it isn’t registering:
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
This is the code I’ve inserted into the php and it still hasn’t taken effect on the mobile panel.
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
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
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:
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!
No, look at the pictures.
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.
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.
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
The issue related to '‘Custom code not registering on mobile devices’' has been successfully resolved, and the topic is now closed for further responses