Text slider over video appearing on all pages too

Hi There

I hope you are well :slight_smile:

I am trying to use a video on the slider of our homepage: www.chanellevirtualassist.com.I used some code that I saw Kharis provided in another topic (I have also installed Javascript Plugin) and used this code:

(function($){
      
    "use strict"

    var mainTitle    = 'Chanelle Virtual Assist';
    var subTitle     = 'Lightening Your Load';
    var buttonURL    = '#';
    var buttonLabel  = 'START HERE';
    
    var heroContent  = '<div class="slide-inner">';
        heroContent += '<div class="contain text-slider">';
        heroContent += '<h2 class="maintitle">'+mainTitle+'</h2>';
        heroContent += '<p class="subtitle">'+subTitle+'</p>';
        heroContent += '</div>';
        heroContent += '<a href="'+buttonURL+'" class="roll-button button-slider" target="_top">'+buttonLabel+'</a>';
        heroContent += '</div>';

    $('.sydney-hero-area').append(heroContent);

})(jQuery);

The problem is that it is also appearing on all the other pages for example:
http://chanellevirtualassist.com/contact/ and I only want this text to appear on the homepage video slider.

Our website has a Password: SHANISEPAD

Any help would be much appreciated.

Best,
Mel

Hello Mell,

Try to replace this line in the code above:

$('.sydney-hero-area').append(heroContent);

…with this:

$('.sydney-hero-area #wp-custom-header-video').append(heroContent);

Please feel free to ask any other questions that you might have.

Kind Regards, Roman.
aThemes Support

Hi Roman,

Many thanks for your reply :slight_smile: much appreciated for the advice as well :slight_smile:

This code worked on the pages, but it did take the writing off the video on the homepage :frowning:

Did I do something wrong?

Thank you so much for everything Roman, really appreciated it.

Best,
Melissa

Okay Melissa, try this code instead:

$('body.home .sydney-hero-area').append(heroContent);

Kind Regards, Roman.
aThemes Support

Hi Roman,

It worked :tada: yayyyyy thank you so much, I really appreciate your help always.

Have a lovely day further :slight_smile:

Best,
Mel

1 Like

You are welcome Mel!

Have a good day as well :slight_smile:

Kind Regards, Roman.
aThemes Support