2011-10-14 24 views
0

我正在嘗試添加自定義頁面模板以僅顯示特定頁面的一個側欄。向論文添加自定義頁面模板

我創建了論文文件夾中的模板頁,我把這些線

<?php echo thesis_header(); ?> 
<?php echo thesis_nav_menu(); ?> 
    <div id="custom-page"> 
     <div class="content-column"> 
      <?php echo thesis_content(); ?> 
     </div> 
     <div class="sidebars"> 
      <?php echo thesis_sidebar_1(); ?> 
     </div> 
    </div> 
<?php echo thesis_footer_area(); ?> 

我發現了一個教程這個代碼,但是當我打開任何頁面,這個模板,頁面犯規正確顯示。因爲所有<頭> < /頭>部分丟失。 thesis_header()函數不會帶HTML頁面的部分。

我的問題;我怎樣才能添加所有這些部分就像thesis_html_framework()呢?

謝謝..

回答

0

我找不到合理的方法,我決定用jQuery修改結構。這是自定義模板文件只顯示一個側邊欄。我不知道完美的解決方案,但它拯救了一天。

<?php 
    /** 
    * Template Name: Custom - One Sidebar Template 
    * 
    * A custom template for use with Thesis theme for creating pages that add a left sidebar. 
    * DO NOT EDIT THIS FILE. Instead, use the thesis_hook_custom_template() hook in custom/places_template_functions.php 
    * 
    * @package Thesis 
    */ 
    add_action('thesis_hook_after_html', 'set_one_sidebar'); 

    thesis_html_framework(); 

    function set_one_sidebar(){ 
     ?> 
     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> 
     <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> 
     <!-- 
     $(document).ready(function(){ 
      $('#sidebar_2').hide(); 
      $('#sidebars').css('width', '230px'); 
      $('#content').css('width', '718px'); 
      $('#content_box').css('background-position', '715px'); 
     }); 
     //--> 
     </SCRIPT> 
     <?php 
    } 
?> 
0

你有沒有找到更好的解決方案?我花了一兩天的時間試圖找出如何重建論文框架,這樣我就可以調整網站的寬度來尋找頁面。在我嘗試(成功)在調用框架函數後重寫css之後,使用您的修復程序結束。

類似:

thesis_html_framework(); 
<style> css stuff </style> 

,使程序在體內的最終拋出,可能不是一個好的解決方案。

+1

可能不是一個好的解決方案,但它節省了一天..在某些情況下,這是我們能做的最好的.. – dvdmn