繁体   English   中英

Jigoshop样式问题

[英]Jigoshop Styling Issue

我试图让jigoshop将所有东西都放入我的主容器中,但似乎没有用。

我的模板如下:

<?php get_header(); ?>
<div id="productsidebar"><?php get_sidebar('products'); ?></div>
<div id="contentwrap">

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
        <div class="entry">
            <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>

            <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

        </div>
    </div>
    <?php endwhile; endif; ?>
</div><!-- #content -->
<?php get_footer(); ?>

而且我按照Jigoshops主题( http://forum.jigoshop.com/kb/customize-jigoshop/wrap-your-themes-content-for-jigoshop )将其保存在函数文件中

function mytheme_open_jigoshop_content_wrappers()
{
echo '<div id="productsidebar"></div><div id="contentwrap">';
}

function mytheme_close_jigoshop_content_wrappers()
{
echo '</div>';
}

function mytheme_prepare_jigoshop_wrappers()
{
remove_action( 'jigoshop_before_main_content', 'jigoshop_output_content_wrapper', 10 );
remove_action( 'jigoshop_after_main_content', 'jigoshop_output_content_wrapper_end', 10);

add_action( 'jigoshop_before_main_content', 'mytheme_open_jigoshop_content_wrappers', 10 );
add_action( 'jigoshop_after_main_content', 'mytheme_close_jigoshop_content_wrappers', 10 );
}
add_action( 'wp_head', 'mytheme_prepare_jigoshop_wrappers' );

当我将边栏功能放在功能文件中时,这显然是错误的。

任何人都可以建议如何做到最好吗?

网站是http://upholstery180degree.co.uk/NewSite/

谢谢

分析代码后,您的功能将产品页面放入指定的主容器中。

<div id="contentwrap">
    <ul class="products">
    <li class="product first">

尽管从外观上看,您正在为商店页面使用不同的模板,这导致它显示您网站上的小部件。 您的代码工作正常,我将进入您的产品页面并更改其使用的模板类型,并将其与其他页面相同。 另外,您也不需要侧边栏div信息,因为它不是主包装的一部分。

function mytheme_open_jigoshop_content_wrappers()
{
    echo '<div id="contentwrap">';
}

function mytheme_close_jigoshop_content_wrappers()
{
    echo '</div>';
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM