Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 短代码在产品页上不起作用_Wordpress_Woocommerce_Shortcode - Fatal编程技术网

Wordpress 短代码在产品页上不起作用

Wordpress 短代码在产品页上不起作用,wordpress,woocommerce,shortcode,Wordpress,Woocommerce,Shortcode,我正在制作一个插件,我不明白如果我插入woocommerce产品页面,为什么我的短代码不起作用 如果我将它添加到其他页面上,而不是产品页面上,它确实可以工作 添加的快捷码非常简单: add_shortcode('testing', 'testingform'); function testingform() { ob_start(); echo 'Width:<br> <input type="text" name="width" id="

我正在制作一个插件,我不明白如果我插入woocommerce产品页面,为什么我的短代码不起作用

如果我将它添加到其他页面上,而不是产品页面上,它确实可以工作

添加的快捷码非常简单:

add_shortcode('testing',  'testingform');

    function testingform() {
       ob_start();
    echo 'Width:<br>
  <input type="text" name="width" id="width"><br>
Height:<br>
  <input type="text" name="height" id="height"><br>
Scale:<br>
  <input type="text" name="scale" id="scale"><br><br>
  <input type="submit" name="submit" id="submitbtn"><br>
<button type="button" id="stripbtn">Show Strips</button>

<div class="wallpapercontainer">
<div class="holder">
  <div class="wallpaper">

  </div>
</div>
  <div class="heightbar"></div>
  <div class="widthbar"></div>
</div>';
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
add_shortcode('testing','testingform');
函数测试表单(){
ob_start();
回声宽度:

高度:

比例:



展品 '; $output=ob_get_contents(); ob_end_clean(); 返回$output; }
Hi jojo,我能看看你的短码功能吗?可能有一些代码使您的短代码无法工作。函数是否在类中?而不是在类中。已添加。很抱歉回复太慢。在产品页面中的位置和方式?它是通过divi中文本/代码模块中的短代码输入的,就像我在其他页面上做的一样。因此,大多数情况下,没有人能够真正帮助您,因为我们无法重现您的问题,这是一个涉及商业主题和模块的非常具体的问题(可能还有其他定制)…