How to remove slider from the mobile view Hellfire theme

Latest Reply from Ashgo at 2013-12-26 05:15:30
Hi, I would like to remove the slider only from mobile version.
How does the framework determine whether to display the mobile or normal view?
Thanks in advance for advices!
Solution #1.

css/tablet.css, css/mobile.css

.slider-container { display:block; } ===> .slider-container { display:none; }


but slider steel loading, killing traffic. so

Solution #2.
functions.php
add:

function ifmobile() {
if (preg_match('/mobi/i', $_SERVER['HTTP_USER_AGENT'])) return TRUE;
}

top.php
Change:

<?php if ((is_front_page()&&$SMTheme->get( 'slider', 'homepage'))||(!is_front_page()&&$SMTheme->get( 'slider', 'innerpage'))) { ?>
<div class='slider-container'>
<?php $SMTheme->block_slider(); ?>
</div>
<?php } ?>

to:

<?php if (!ifmobile()&&((is_front_page()&&$SMTheme->get( 'slider', 'homepage'))||(!is_front_page()&&$SMTheme->get( 'slider', 'innerpage')))) { ?>
<div class='slider-container'>
<?php $SMTheme->block_slider(); ?>
</div>
<?php } ?>


Slider not loading in mobile & tablet view.

Leave a reply

Add codeAdd image