2016-04-16 41 views
-1

我從頭開始使用引導和網站使用wordpress,但現在我想使用wordpress和woocommerce電子商務網站,但我也想利用bootrap的命令的響應能力。我如何將bootstrap集成到我創建的wordpress主題中?如何使用wordpress和woocommerce的bootstrap?

+2

請縮小到具體的問題你的問題。你的問題太寬泛,無法回答。 – geeksal

回答

4

在你的主題/子主題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'); 
1

只是引導的風格和JavaScript添加到主題標題,然後利用所描述的響應類: http://getbootstrap.com/css/#responsive-utilities

+0

將JavaScript放入標題是一種不好的做法。另外,foor wordpress,我記得有'wp_'函數可以處理javascript。 –

+0

如果它是您的自定義模板,這不是一個壞習慣。 –

+0

接受的答案就是我的意思。 +1爲自定義事實 –