如何使用wordpress和woocommerce引导程序?

TDP*_*TDP 0 css wordpress twitter-bootstrap woocommerce

我使用bootstrap和使用wordpress的网站从头开始制作网站,但现在我想使用wordpress和woocommerce创建一个电子商务网站,但我也想利用bootrap的命令来响应.如何将bootstrap集成到我正在创建的wordpress主题中?

小智 6

在你的theme/child-theme functions.php文件中,你应该将你的css和javascript文件排入队列.

例如:

function theme_enqueue_styles() {


   wp_enqueue_style( 'bootstrap-theme-style', '/wp-content/themes/' . get_stylesheet() . '/assets/css/bootstrap.min.css' );
   wp_enqueue_script( 'bootstrap-min-script', '/wp-content/themes/' . get_stylesheet() . '/assets/js/bootstrap.min.js', array(), true );

}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
Run Code Online (Sandbox Code Playgroud)