我正在开发一个基于Woocommerce的网站,现在我在单页上.我怀疑的是如何重新排序那里的一些钩子.最初,我们有此订单(优先级):
<?php
/*
* @hooked woocommerce_template_single_title - 5
* @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
*/
?>
Run Code Online (Sandbox Code Playgroud)
根据我的布局,我需要按顺序放置元素:
1: Title
2: Name of the product category (last level category where that product was classified in the admin)
3: Quantity switch and "add to cart" button
4 and last: Description
Run Code Online (Sandbox Code Playgroud)
如何在我的主题中的"函数"文件中重新定义它?有任何想法吗?
ame*_*wer 11
这是很久以前但是如果有人有兴趣,在functions.php文件中删除并添加您自己的操作以重新排序单个产品摘要的内容:
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40);
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 5 );
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
8803 次 |
最近记录: |