Wordpress全球产品退货专用标题
我使用WordPress和woocommerce插件,尝试显示第393页的标题部分,并在她之后显示当前产品的内容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
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中安装plugininsert 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);