在我的网站(我正在本地开发)中,我更改了 WooCommerce 单一产品页面的行为。该网站使用英语和荷兰语。我从产品区域中删除了产品摘要,并将其显示在侧边栏中。这是侧边栏的代码:
<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
<div id="secondary" class="widget-area" role="complementary">
<?php if ( !is_product() )
{
}
else
{?>
<aside id="product-summary" class="product-summary-custom widget">
<?php if ( is_product() ) {?>
<h3 class="widget-title"><?php printf(__('buy this photo:')) ;?></h3>
<?php do_action( 'woocommerce_single_product_summary' );?>
</aside>
<?php }
}
dynamic_sidebar( 'sidebar-1' ); ?>
</div><!-- #secondary -->
<?php endif; ?>
问题是它只显示在英文网站上,当我将语言更改为荷兰语时,它就消失了。改回英文让它再次出现。该网站是使用 WPML 插件翻译的。
第一个屏幕截图是它的外观,第二个屏幕显示错误的结果。
自 Woocommerce 更新到 2.2.3 后,这种奇怪的行为就出现了。今天更新了。任何人的想法?