Why doesn't bootstrap dropdown tabs on the inner pages (main work)?

Good time of day. Made a dropdown menu using bootstrap script collapse. On the main page all works as a watch. BUT on the inside pages - the conclusion is not running. Nothing happens.

I think it's because of the address but I can not understand where wrong.
Bootstrap itself is connected to the header, the script collapse hooked up in the basement. Here in this way. The folder with these files lying in the root directory of WP.
<script type="text/javascript" src="/boot-file/bootstrap.min.js"></script>


As the pages of the website are:
MySite/navaneelan


Then a click in menu address changes to:
MySite/pagename#secondpanel

But the menu itself does not expand.

Code the menu like this
<div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> <img src="/img-smena/menu_03.png"> </a> </h4> </div> <div id="collapseOne" class="panel-collapse collapse"> <div class="panel-body"> the <ul> the <li><a href="/raspolozhenie/">location</a></li> the <li><a href="/shema-legerya/">scheme camps</a></li> the <li><a href="/pitanie/">food</a></li> the <li><a href="/plyazh-i-letniy-dush/">beach and an outdoor shower</a></li> </ul> </div> </div> </div>
July 2nd 19 at 13:54
2 answers
July 2nd 19 at 13:56
for wp the path you need to specify here

<script type="text/javascript" src="<?php echo get_template_directory(); ?>/boot-file/bootstrap.min.js"></script>
Now it takes the address of those hosting the link is at all true it turns out - Audrey.Dibbert commented on July 2nd 19 at 13:59
: well, you put a file in a folder with the theme? - Layne_Gutkows commented on July 2nd 19 at 14:02
: Yes, of course put. I say that it is not true creates a link. мой_сайт/home/d26530/public_html/demo2/wp-content/themes/start/boot-file/bootstrap.min.js - Audrey.Dibbert commented on July 2nd 19 at 14:05
strange , need to see the files and the website. As an alternative advise a cdn https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js... - Layne_Gutkows commented on July 2nd 19 at 14:08
July 2nd 19 at 13:58
Almost as suggested, only slightly different. get_template_directory returns a path, and we need a URL get_template_directory_uri.
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/boot-file/bootstrap.min.js"></script>

However, this method is still wrong, the scripts and styles have to load using wp_enqueue_scripts()
It is connected to. But the tabs won't open. Instead of expanding it just appends the anchor to the link http://мой_сайт/raspolozhenie#collapseOne - Audrey.Dibbert commented on July 2nd 19 at 14:01
: so do not work out the script. First - look based on. He needs jQuery? Make sure that it is connected. And even if it is connected, will be the second point in WP jQuery runs in noConflict mode. If your script uses $ - will not work. See console for errors. In General, as I wrote, all scripts need to connect via wp_enqueue_scripts jQuery to specify as a dependency, and the js code to write given the noConflict mode. All this is described in the documentation at the link. - Layne_Gutkows commented on July 2nd 19 at 14:04
: As it turns out. On the main page when you click on menu it does not change even the address of the page. The very menu link it turns out MySite/#меню1. But on the inner page the script is just not handled, and links are of the form: MySite/pagename#меню1 - as usual the anchor is working. - Audrey.Dibbert commented on July 2nd 19 at 14:07
: All right. Because the reference is invoked by javascript, but it's not working correctly, the console must be a bug that will explain why that is wrong. Not likely to see $ - Layne_Gutkows commented on July 2nd 19 at 14:10

Find more questions by tags HTMLBootstrapWordPressCSS