Static Image Instead Of Slider


#1

Hi

I saw a similar post not too long ago. Is the feature to just show a static image instead of a slider available yet on the pagespeed theme? On the other hand, is it possible to even a video playing instead of the slider? Thanks!


#2

We don’t have plans for such feature.
You can achieve what you are looking for with few lines of custom code.


#3

Hi Satish. Can you share with me the lines of code to use? I just paid for the lifetime plan. Thanks!


#4

Add this code to functions.php file in your parent or child theme.

add_action( 'pagespeed_after_header', 'my_custom_image', 15 );

function my_custom_image(){
    if(!is_home()){
        return;
    }
    global $helium;
    if($helium->is_mobile()){
       //Different image for mobile. You can use image, video or any custom html here.
        echo '<img src="http://mydomain.my-image.jpg" class="full">';
    }else{
        echo '<img src="http://mydomain.my-image.jpg">';
    }
}