[英]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.