Bootstrap 下拉菜单不显示 Wordpress 下拉菜单中的项目

我正在开发一个子主题,并在我的主题的通用 wp_enqueue_style 之前添加了 Bootstrap,如下所示:

if ( ! function_exists( 'ghostpool_enqueue_child_styles' ) ) {
    function ghostpool_enqueue_child_styles() { 
        wp_enqueue_script( 'bootstrap_js','https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js',array('jquery'),NULL,true );
        
        wp_enqueue_style( 'bootstrap_css','https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css',false,'all' );
        
        wp_enqueue_style( 'ghostpool-style',get_template_directory_uri() . '/style.css',array(),AARDVARK_THEME_VERSION );
        wp_enqueue_style( 'ghostpool-child-style',get_stylesheet_directory_uri() . '/style.css',array( 'ghostpool-style' ),AARDVARK_THEME_VERSION );
        wp_style_add_data( 'ghostpool-child-style','rtl','replace' );
    }
}
add_action( 'wp_enqueue_scripts','ghostpool_enqueue_child_styles' );

然后我在每列中添加了一行 4 列的原始 HTML,如下所示:

<div class="dropdown">
  <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownmenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    CHOOSE A GENRE
  </button>
  <div class="dropdown-menu" aria-labelledby="dropdownmenuButton">
    <a class="dropdown-item" href="#">action</a>
    <a class="dropdown-item" href="#">Another action</a>
    <a class="dropdown-item" href="#">Something else here</a>
  </div>
</div>

我的下拉按钮显示正确,但是当我点击它们时,它们不显示下拉菜单中的内容?我忘记在functions.php中添加任何特殊的js了吗?我错过了什么吗?

hope1109 回答:Bootstrap 下拉菜单不显示 Wordpress 下拉菜单中的项目

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/12716.html

大家都在问