Okay
  Public Ticket #365685
question re: updating files in child theme for removing looping from nectar slider
Closed

Comments

  • Matt started the conversation

    Hi Tahir,

    I followed your advice in this article (http://themenectar.ticksy.com/ticket/154993/search... about removing the looping from the video in the nectar slider looping.

    I updated the functions.php and nextar-slider.js files and put the updated files back in the "Salient" folder on my ftp.

    ...Do I need to also put these 2 files in my "Salient-child" folder so they're not overwritten when I update the Salient theme at a later date?  If so, what sort of file structure do I need to preserve in the "Salient child" folder.

    root level:

    1) functions.php

    2) js folder

    >>within js folder: 

    nectar-slider.js file

    ?

    thank you,

    Matt

  •  1,075
    ThemeNectar replied

    Hey Matt, here\'s quick writeup I did on moving css files into the child theme - the process will be very similar for js files

    http://themenectar.ticksy.com/ticket/167594/search/

    Cheers

  • Matt replied

    Hi Nectar,

    Thank you! I understand the process at a high level, however I'm uncertain about the code I need to insert. If you'll allow me to lay it out below...


    1) If the following is the block of code in the functions.php file that had been updated (by just removing the "loop autoplay" after "preload="auto"), do I add this entire block to the functions.php in the child theme as so?:

     <div class="video-wrap">
    <video class="slider-video" width="1800" height="700" preload="auto">';
    if(!empty($video_webm)) { $slider .= '<source type="video/webm" src="'.$video_webm.'">'; }
    if(!empty($video_mp4)) { $slider .= '<source type="video/mp4" src="'.$video_mp4.'">'; }
    if(!empty($video_ogv)) { $slider .= '<source type="video/ogg" src="'. $video_ogv.'">'; }
    $slider .='</video>


    2) For the nectar-slide.js file, per your other article, I removed this code so, I'm confused what would need to be added to the child theme file to indicate that this has been removed (do I just add the entire new file into the js folder into the child theme folder?):

    //play video user is hovering over 
        $('body').on('mouseover','.swiper-slide', function(){ 
            if($(this).find('video').length > 0 && $(this).find('video').get(0).paused == true && $animating == false){ 
                $(this).find('video').get(0).play(); 
            } 
        });


    Once again, I appreciate your help and guidance!

    best,

    Matt

  •  1,075
    ThemeNectar replied

    Hey matt,

    1. You'd need to copy over the entire nectar_slider_display function into your child theme as that will be used instead of the default one in the parent theme

    2. You will indeed need to add the entire file into the a child theme js folder but then also add that function into the functions.php that I referenced above (but mod it to use the init.js file instead of a stylesheet)

    Cheers

  •   Matt replied privately
  •  1,075
    ThemeNectar replied

    Hey again - this is the actual function you'd place into the child theme functions.php to get the init.js file to load from your child theme

    add_action( 'wp_enqueue_scripts', 'javascript_init_script_fix', 20 ); function javascript_init_script_fix() { wp_dequeue_script( 'nectarFrontend' ); wp_enqueue_script( 'salient-child', get_stylesheet_directory_uri() . '/js/init.js', array( 'jquery' ) ); }
    


  •   Matt replied privately
  • Matt replied

    Hi again,

    Just wanted to followup from my private comment above.

    thank you,

    matt

  •  1,075
    ThemeNectar replied

    Hey Matt,

    Yes that looks accurate

    Cheers

  •   Matt replied privately
  •  8,848
    Tahir replied

    Hey Again!

    See screenshot: http://prntscr.com/666wte . Might be a File Permission Issue see url: codex.wordpress.org/Changing_File_Permissions .

    Thanks


    ThemeNectar Support Team 

  • Matt replied

    Hi Tahir,

    Hmmm...I am using a shared hosting plan with godaddy and never had this issue with using a Salient child theme with before.

    I guess the bigger question is --- is there an update coming that would allow me to stop the looping on the video in the Nectar slider? : )

    thanks again,
    Matt

  •  1,075
    ThemeNectar replied

    Hey Matt, it's not going to make it into the next release but i've noted your +1 for the idea :)