Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Blogger12

    (@blogger12)

    I added it to the bottom of the theme’s function.php file right before the last bracket and it did not do anything. I am using an Ink Theme template. Does that matter? Or did I not place it in the correct place in the file?

    Here is the code:

    function change_magnific_popup_iframe_setting(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery(‘a[href*=”youtube.com/watch”]’).magnificPopup({
    type: ‘iframe’,
    iframe: {
    patterns: {
    youtube: {
    index: ‘youtube.com’,
    id: ‘v=’,
    src: ‘//www.youtube.com/embed/%id%?rel=0&autoplay=1’
    }
    }
    }
    });
    });
    </script>
    <?php
    }
    add_action(“wp_footer”, “change_magnific_popup_iframe_setting”);

    Thread Starter Blogger12

    (@blogger12)

    Thanks Alan.

    I was able to get the videos to play using option 1. Definitely the easiest method.

    But I am not sure I understand the post to get them to autoplay.

    Here is the link to the code — but I am not sure where to put it. Also do I insert the entire code or is there a key line? Does it go in the theme stylesheet under “Appearance” — then “Editor”?

Viewing 2 replies - 1 through 2 (of 2 total)