我已经创建了自己的短代码。很遗憾,我无法共享代码/
当我在我的页面上使用它时,它的行为很奇怪。它始终具有最高优先级。我是指页面编辑器中的类似内容:
Text
[shortcode]
页面上的输出:< shortcode contents >
Text
在页面编辑器中:[shortcode]
Text
[shortcode]
提供:< shortcode contents >
< shortcode contents >
Text
所以我无法在我的短代码之前和之间放置任何东西。更详细地说,我的短代码使用了一些ifs、foreach和循环(它们从自定义post类型获取和显示数据)。
知道为什么会这样吗?
[编辑]
OK, so I\'ve been using echoes instead of return. My bad. Is there any way of return my whole function without editing every single line and adding $output etc.?