<?php 
    if( is_page_template('templates/page_one_page.php') ){
        ts_onepage_menu_js();
        wp_nav_menu( 
            array( 
            'theme_location'  => 'onepage_menu',
            'items_wrap'      => '<div id="menu-onepage-menu" class="%2$s navbar-collapse collapse"><ul class="nav navbar-nav">%3$s</ul></div>', 
            )
        ); 
        ?>
        <script>
            jQuery(document).ready(function($) {

                 jQuery('#menu-onepage-menu').onePageNav({

                    currentClass: 'current_page_item',
                    changeHash: false,
                    scrollSpeed: 900,
                    scrollOffset: 75,
                    scrollThreshold: 0.1,
                    filter: ':not(.external)',
                    begin: function() {
                        //I get fired when the animation is starting
                    },
                    end: function() {
                        //I get fired when the animation is ending
                    },
                    scrollChange: function() {
                        //I get fired when you enter a section and I pass the list item of the section
                    }
                });
            });
        </script>
        <?php

    }else{

        wp_nav_menu( array(
            'theme_location'    => 'mega_menu',
            'depth'             => 3,
            'container'         => false,
            'container_class'   => false,
            // 'menu_class'        => 'nav navbar-nav',
            'items_wrap'        => '<ul  id="tiny">%3$s</ul>', 
            'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
            'walker'            => new ts_bootstrap_navwalker()
        )
    );

    }