dpii73380 2014-12-09 15:19
浏览 60
已采纳

Wordpress Woocommerce短代码没有运行

I'm trying to add woocommerce to my website but the shortcodes within the pages aren't running.

I've installed and activated and most of the settings have been left default. In my page.php file I have the following:

<?php do_shortcode( '[woocommerce_cart]' ); ?>

I'm certain it's opening the correct template page because I can add random text.

I was getting the content before but changed it to the above to simplify everything. I've tried wiping my functions.php incase something was trying to stop it but still nothing shows.

From my understanding by running that shortcode it should route towards the template/cart.php file within my woocommerce plugin, but all it returns is a blank page.

  • 写回答

1条回答 默认 最新

  • dsf6565 2014-12-09 15:32
    关注

    do_shortcode() returns stuff, you need to echo:

    echo do_shortcode( '[woocommerce_cart]' ); 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Marscode IDE 如何预览新建的 HTML 文件
  • ¥15 K8S部署二进制集群过程中calico一直报错
  • ¥15 java python或者任何一种编程语言复刻一个网页
  • ¥20 如何通过代码传输视频到亚马逊平台
  • ¥15 php查询mysql数据库并显示至下拉列表中
  • ¥15 freertos下使用外部中断失效
  • ¥15 输入的char字符转为int类型,不是对应的ascall码,如何才能使之转换为对应ascall码?或者使输入的char字符可以正常与其他字符比较?
  • ¥15 devserver配置完 启动服务 无法访问static上的资源
  • ¥15 解决websocket跟c#客户端通信
  • ¥30 Python调用dll文件输出Nan重置dll状态