2013-10-23 30 views
0

我正在使用WordPress網站。 Roots主題是由其他人安裝的。我想盡可能直接編寫頁面而不使用Bootstrap。我不完全瞭解WordPress,但它在我看來像base.php是包裝每一頁的代碼。我想知道我能改變多少,而不會搞亂主題。主要是我不想使用Bootstrap。我可以刪除對「容器」和「行」類的引用嗎?順便說一下,'包裝'和'內容'和'主'類是什麼?如何找出roots_main_class()是什麼?有沒有另外一種方法來做到這一點,比如不加載bootstrap.css?WordPress,禁用Roots主題的部分(如Bootstrap)

<?php get_template_part('templates/head'); ?> 
<body <?php body_class(); ?>> 

    <!--[if lt IE 7]><div class="alert"><?php _e('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'roots'); ?></div><![endif]--> 

    <?php 
    do_action('get_header'); 
    // Use Bootstrap's navbar if enabled in config.php 
    if (current_theme_supports('bootstrap-top-navbar')) { 
     get_template_part('templates/header-top-navbar'); 
    } else { 
     get_template_part('templates/header'); 
    } 
    ?> 

    <div class="wrap container" role="document"> 
    <div class="content row"> 
     <div class="main <?php echo roots_main_class(); ?>" role="main"> 
     <?php include roots_template_path(); ?> 
     </div><!-- /.main --> 
     <?php if (roots_display_sidebar()) : ?> 
     <aside class="sidebar <?php echo roots_sidebar_class(); ?>" role="complementary"> 
     <?php include roots_sidebar_path(); ?> 
     </aside><!-- /.sidebar --> 
     <?php endif; ?> 
    </div><!-- /.content --> 
    </div><!-- /.wrap --> 

    <?php get_template_part('templates/footer'); ?> 

</body> 
</html> 

回答

3

你的問題試圖掩蓋了很多的不同點。幾點意見:

  1. 如果你不完全瞭解Wordpress,那麼我強烈建議你先熟悉WP文檔。
  2. Bootstrap是一個框架;你爲什麼不建立在它之上並以此爲出發點呢?
  3. 如果你真的不想使用引導程序那麼這將是一個簡單得多切換到不同的主題
  4. 望着根主題,有沒有bootstrap.css;有main.min.css。你可以:A)直接編輯,B)通過註釋lib/scripts.php的第14行,排除你自己的CSS,或者C)保持原樣,並通過將它排入'lib/scripts.php`。要了解如何在WP中排版樣式表,請參閱WP Codex entry for wp_enqueue_style

我強烈地考慮重新考慮你的問題,以便更容易回答,也許可以將它作爲單獨的問題發佈,而不是一個多方面的問題。

+0

你是對的,我很困惑,並且抓住了我所能得到的任何信息。感謝您花時間回答問題,而不僅僅是對我的問題進行投票。我不想使用Bootstrap的原因是我專注於構建我的網站外觀的某些方面,特別是讓邊緣對齊,並且我一直在對付Bootstrap和Roots。 Bootstrap的主要目的之一是使網站能夠響應屏幕寬度和移動設備,這對我來說並不是什麼高優先級。我想我會切換主題。我正在研究WP框架,這是一個「空白」的主題。 – composerMike

+0

你可能想看的另一個初學者主題是(Bones。)[http://themble.com/bones/]我在很多項目中使用過它;這不是一個'空白'的主題,因爲它有一些造型,但重量輕,容易移除或適應。我喜歡它,因爲所有文件都有很好的文檔記錄。還有一個[使用Bones作爲起點的3部分指南WP-tuts指南。](http://wp.tutsplus.com/tutorials/theme-development/making-a-theme-with-bones-getting-開始/)祝你好運! – Dre