添加属性时,php中最高评级的产品do_shortcode不起作用

发布于 2025-02-12 03:02:06 字数 278 浏览 2 评论 0原文

当我添加此代码时:

<?php
echo do_shortcode("[top_rated_products orderby="rand" per_page="15"]");
?>

在我的PHP页面中,它不起作用,但是当我使用此代码时,它可以使用:

<?php
echo do_shortcode("[top_rated_products ]");
?>

有什么方法可以允许使用第一个代码?

When I add this code:

<?php
echo do_shortcode("[top_rated_products orderby="rand" per_page="15"]");
?>

to my php page, it doesn't work, but it works when I use this:

<?php
echo do_shortcode("[top_rated_products ]");
?>

Is there any way to allow for the first code to be used?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撕心裂肺的伤痛 2025-02-19 03:02:06

您必须将短代码包裹在单语句中

do_shortcode('[top_rated_products orderby="rand" per_page="15"]');

You have to wrap the shortcode in single quotes like

do_shortcode('[top_rated_products orderby="rand" per_page="15"]');
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文