我希望能够显示wordpress插件的页面:‘可湿性粉剂电子商务’在一个不同的页面模板,而不是正常的index.php页面。
购物车的一个示例URL是: products-page/checkout/
但是,它正好适合index.php模板中的内容。有没有办法创建一个不同的页面模板或if/else语句,根据用户所在的电子商务页面进行更改,就像原生wordpress层次结构的工作方式一样?
谢谢!
发布于 2012-11-24 03:28:04
我发现您可以使用条件语句来定位页面标题,然后将页面标题用于结帐页面,并创建了以下内容:
<?php
if (is_page( 'Checkout' ) ) {
if ( have_posts() ) : while ( have_posts() ) : the_post();
the_content();
endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
<?php }
else{ ?>
<!--Normal Page Content-->
<?php } ?>https://stackoverflow.com/questions/13534584
复制相似问题