Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.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 - Fatal编程技术网

Wordpress全球产品退货专用标题

Wordpress全球产品退货专用标题,wordpress,woocommerce,Wordpress,Woocommerce,我使用WordPress和woocommerce插件,尝试显示第393页的标题部分,并在她之后显示当前产品的内容 add_action( 'woocommerce_before_single_product', 'get_header_work_portfolio' ); function get_header_work_portfolio() { global $product; echo '<div class="row"> <div class="col-xs-1

我使用WordPress和woocommerce插件,尝试显示第393页的标题部分,并在她之后显示当前产品的内容

add_action( 'woocommerce_before_single_product', 'get_header_work_portfolio' );

function get_header_work_portfolio() { global $product;

echo '<div class="row">   <div class="col-xs-12 col-sm-12 mt10pr">
    <div class="col-xs-12 col-md-4">show me</div>
    <div class="col-xs-12 col-md-8">';
      //here must show description of product
    echo '</div>   </div> </div>';

当我尝试在function.php中调用
$product
时,它将返回产品的唯一标题。。。我只想获取当前产品的描述…

single product.php中删除此代码

$id=393;    
$content = get_the_content($id);
$content = apply_filters('the_content', $content);
因为wordpress捕捉到了这个id,一切都崩溃了

在single-products.php中安装plugin
insert pages
并添加页面的短代码,如下所示
echo-do|u短码(“[insert page='page-Leag'display='all | content | title']”)

试试这个$product=wc\u get\u产品(id);echo$product->get_the_content();`未捕获错误:调用字符串“i无法捕获产品ID”上的成员函数get_ID()
$id=393;    
$content = get_the_content($id);
$content = apply_filters('the_content', $content);