我正在尝试更改简短描述摘录长度.
我发现之前的帖子说我应该改变
<?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?>
Run Code Online (Sandbox Code Playgroud)
至
<?php $excerpt = apply_filters( 'woocommerce_short_description', $post->post_excerpt );
echo substr($length,0, 10);
?>
Run Code Online (Sandbox Code Playgroud)
然而,当这样做时,我的摘录就会消失.
我试图在单一产品页面的Woocommerce中围绕价格和购物车挂钩添加DIV.
content-single-page.php文件如下所示:
<?php
/**
* woocommerce_single_product_summary hook.
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_rating - 10
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
*/
do_action( 'woocommerce_single_product_summary' );
?>
Run Code Online (Sandbox Code Playgroud)
我想在这些钩子周围添加一个DIV:
hooked woocommerce_template_single_price - 10
woocommerce_template_single_add_to_cart - 30
Run Code Online (Sandbox Code Playgroud)