2013-07-10 117 views
0

bootstrap崩潰導航不工作在我的wordpress主題移動 當我在移動/ iphone上使用它的菜單隱藏在使用的圖像圖標後面,但當我點擊這個圖像它不會摺疊並且不顯示所有列表項目。bootstrap崩潰導航不工作在我的wordpress主題在手機

<div class="container"> 
<div style="position: static;" class="navbar navbar-inverse"> 
      <div class="navbar-inner"> 
      <div class="container"> 
       <a data-target="navbar-inverse-collapse" data-toggle="collapse" class="btn btn-navbar"> 
       <span class="icon-bar"></span> 
       <span class="icon-bar"></span> 
       <span class="icon-bar"></span> 
       </a> 
       <a href="#" class="brand"><img src="<?php echo get_template_directory_uri();?>/images/spa_logo.png" alt="spasalon" /></a> 
       <div class="nav-collapse collapse navbar-inverse-collapse"> 

        <?php 
      if (has_nav_menu('header-menu')): 

      wp_nav_menu(array( 'menu'  => 'header-menu', 
         'theme_location' => 'header-menu', 
         'depth'  => 3, 
         'container' => false, 
         'menu_class' => 'nav', 
         'menu_id'=>'a', 
         'show_home'=>'HOME', 
         'fallback_cb' => 'wp_page_menu', 

         'walker' => new twitter_bootstrap_nav_walker() 
         ) 
         ); 


     endif; ?> 


    </div><!-- /.nav-collapse --> 
      </div> 
      </div><!-- /navbar-inner --> 
     </div> 

+0

你有沒有看着https://github.com/twitter/bootstrap/issues/4497 – 2013-07-14 23:10:50

回答

0

我會嘗試加入引導,collapse.js作爲一個單獨的文件wp_register_script()在你的函數文件。並確保您正確添加bootstrap.min.js。我有這個相同的問題,然後正確排入我的js文件,然後它現在工作得很好。

0

我在爲我的blog創建主題時找到了解決方案。

添加腳本...

<script src="js/bootstrap.min.js"></script> 
  • 請到的functions.php文件到主題文件夾並添加以下功能。

    function tsbs2013_scripts_with_jquery(){ 
    
        // Register the script like this for a theme: 
        wp_register_script('custom-script', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery')); 
    
        // For either a plugin or a theme, you can then enqueue the script: 
        wp_enqueue_script('custom-script'); 
    } 
    
    add_action('wp_enqueue_scripts', 'tsbs2013_scripts_with_jquery'); 
    
+0

請不要僅僅發佈鏈接作爲答案。 –

+0

儘管此鏈接可能回答問題,但最好在此處包含答案的基本部分,並提供供參考的鏈接。如果鏈接頁面更改,則僅鏈接答案可能會失效。 – pilsetnieks

+0

我在回答中添加了說明。你可以請現在註冊嗎? –