douren1891 2013-02-28 09:21
浏览 35

Jigoshop造型问题

I am trying to get the jigoshop to put everything in my main container and it appears to be not working.

My template is below:

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

And i have this in my functions file as per Jigoshops themeing (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' );

It was obviously erroring when i put the sidebar function in the functions file.

Can anyone advise how best to do this?

Site is http://upholstery180degree.co.uk/NewSite/

thanks

  • 写回答

1条回答 默认 最新

  • douao2000 2013-02-28 10:11
    关注

    After analyzing the code your function is putting the product page in the main container as specified.

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

    Although from what it seems like you are using a different template for your shop page in which is causing it to show the widgets from you site. Your code is working properly, I would go into your product page and change the type of template it is using and have it the same as your other pages. Also you would not need the sidebar div information as it is not part of the main wrapper.

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

报告相同问题?

悬赏问题

  • ¥15 使用ESP8266连接阿里云出现问题
  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角