-
AuthorPosts
-
October 26, 2025 at 4:43 pm #1490604
Hi
Is it possible to disable the fold/unfold feature for text boxes on mobile?
I’ve noticed it takes an age to load on mobile, so resorted to duplicating content in order to load fast on mobile devices.
kind ergards
Duncan
October 27, 2025 at 6:31 am #1490611Hey dweddell,
Thank you for the inquiry.
Looks like you managed to work around this by creating a duplicate of the section with the fold/unfold option deactivated. If you still need to disable this feature on mobile, please try this css:
@media only screen and (max-width: 768px) { /* Add your Mobile Styles here */ .av-fold-unfold-container { max-height: max-content !important; } .avia-fold-unfold-section .av-fold-button-wrapper { display: none; } }Best regards,
IsmaelOctober 27, 2025 at 10:09 am #1490619Hi Ismael
Thanks, however this seems to hide the ‘read more’ functioanlity
kind regards
Duncan
October 28, 2025 at 6:02 am #1490642Hi,
Thank you for the update.
The read more link is no longer required since the full content is already visible. If you want to keep the link, remove this css rule.
.avia-fold-unfold-section .av-fold-button-wrapper { display: none; }Best regards,
IsmaelOctober 28, 2025 at 10:35 am #1490648Hi Ismael
this doesn’t resolve the time it takes to load element on a mobile with the fold/unfold feature.
is there a way the fold/unfold script/feature can be disabled on mobile?
thanks again
Duncan
October 29, 2025 at 6:33 am #1490676Hi,
Try to add this code in the functions.php file to fully remove the fold/unfold script.
function ava_remove_avia_scripts() { if ( wp_is_mobile() ) { wp_dequeue_script( 'avia-fold-unfold' ); wp_deregister_script( 'avia-fold-unfold' ); } } add_action( 'wp_enqueue_scripts', 'ava_remove_avia_scripts', 20 );The condition wp_is_mobile is not accurate and should only work if the page is actually being viewed on a mobile device.
Best regards,
IsmaelOctober 29, 2025 at 10:21 am #1490687Hi Ismael
unfortunately this doesn’t work either on mobile. see page below
kind regards
Duncan
October 30, 2025 at 6:26 am #1490727Hi,
Did you keep the css code? The css code is needed to fully display the content.
Best regards,
IsmaelOctober 30, 2025 at 10:25 am #1490733Hi Ismael
ok no problem. login below
October 30, 2025 at 11:00 am #1490740see page:
October 31, 2025 at 7:41 am #1490801Hi,
The filter we recommended was placed in the style.css file instead of the functions.php file. We removed it and added the following script instead. The text will still display with a slight delay, but the transition should now be disabled.
add_action('wp_footer', function() { ?> <script> jQuery(document).ready(function($) { $(".avia-fold-unfold-section").each(function() { var $section = $(this); var $container = $section.find(".av-fold-unfold-container"); if ($container.length) { $container.css({ "max-height": "none", "transition": "none" }).removeClass("folded").addClass("unfolded"); } var $buttonWrapper = $section.find(".av-fold-button-wrapper"); if ($buttonWrapper.length) { $buttonWrapper.css("display", "none"); } }); }); </script> <?php }, 999);We also edited the modification in the Quick CSS field.
@media only screen and (max-width: 768px) { .av-fold-unfold-container { max-height: none !important; transition: none !important; opacity: 1 !important; } .avia-fold-unfold-section .av-fold-button-wrapper, .av-fold-button-container { display: none !important; } #top .avia-fold-unfold-section .av-fold-unfold-container:after { display: none !important; } .avia-fold-init, .avia-fold-init-done { display: block !important; max-height: none !important; opacity: 1 !important; } }Best regards,
IsmaelNovember 3, 2025 at 4:00 pm #1490890Hi Ismael
Thanks, however this affected the ‘read more’ functionality for screens over 768px.
removed snippet. I think we’ll leave it for the time being
really appreciate time spent on this
kind ergards
Duncan
November 4, 2025 at 1:18 am #1490901Hi,
We adjusted the script slightly and added a condition so it only applies when the screen width is equal to or less than 767px. Please edit the functions.php file and replace the script with this code:
add_action('wp_footer', function() { ?> <script> jQuery(document).ready(function($) { if (window.innerWidth <= 767) { $(".avia-fold-unfold-section").each(function() { var $section = $(this); var $container = $section.find(".av-fold-unfold-container"); if ($container.length) { $container.css({ "max-height": "none", "transition": "none" }).removeClass("folded").addClass("unfolded"); } var $buttonWrapper = $section.find(".av-fold-button-wrapper"); if ($buttonWrapper.length) { $buttonWrapper.css("display", "none"); } }); } }); </script> <?php }, 999);Best regards,
IsmaelNovember 5, 2025 at 3:28 pm #1490979Awesome :)
Many thanks for sorting this out. working a treat now
kind ergards
Duncan
November 5, 2025 at 6:42 pm #1490984Hi,
Glad that Ismael could help, if you have further questions please open a new thread and we will try to help. Thanks for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘fold/unfold disable on mobile’ is closed to new replies.
