[英]Wordpress woocommerce empty my account + car page
尝试安装woocommerce时遇到问题。 我添加成功,但是突然间,我不知道为什么,“我的帐户”页面和“购物车”页面为空,如果我查看源代码,内容就在这里,但是在它们之间,因此是不可见的。 我不知道,一直在互联网和stackoverflow上搜索数小时而没有运气! 有谁知道为什么要这么做吗?
我已经将插件重新安装了三遍,删除了所有内容并重新安装,仍然会发生相同的错误。
我没有触及代码中的任何内容,并且在后端选择了页面
编辑:我的woocommercePage是
<?php get_header(); ?>
<?php woocommerce_content(); ?>
<?php get_footer(); ?>
我的页面是:
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>
<?php get_footer(); ?>
WooCommerce的“我的帐户”和“购物车”页面应该只是常规的WordPress页面。 通过在页面内容中使用短代码来添加WooCommerce功能。 如果需要,您还可以包括其他内容和简码,但是以下简码是必需的。
对于购物车使用:
[woocommerce_cart]
对于我的帐户,请使用:
[woocommerce_my_account]
您的页面模板将需要调用the_content()
以便$post->post_content
值通过the_content
过滤器传递,该过滤器将调用do_shortcode()
处理短代码。
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<!-- output the page content here to process shortcodes -->
<?php the_content(); ?>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>
<?php get_footer(); ?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.