在论文中添加自定义页面模板

时间:2011-10-14 20:19:40

标签: php wordpress wordpress-thesis-theme

我尝试添加自定义页面模板,仅显示特定页面的一个侧边栏。

我在论文文件夹中创建了一个模板页面,我把这些行放在

<?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(); ?>

我在教程中找到了这段代码但是当我用这个模板打开任何页面时,页面都没有正确显示。因为所有&lt;头&GT;&LT;缺少/ head&gt; 部分。 thesis_header()功能不会带来html页面的部分。

我的问题;如何像 thesis_html_framework()那样添加所有这些部分?

感谢..

2 个答案:

答案 0 :(得分: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
    }
?>

答案 1 :(得分:0)

您找到了更好的解决方案吗?我花了一两天试图找出如何重建论文框架,以便我可以调整网站的宽度以获得一些页面。在我尝试(成功)在调用框架函数后覆盖css后,使用您的修复程序结束了。

类似的东西:

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

在身体末端被抛出,可能也不是一个好的解决方案。

相关问题