编辑WooCommerce商店页面,缩略图之前的标题
问题描述:
我已经咬掉了超过我可以咀嚼,需要一些帮助WooCommerce。编辑WooCommerce商店页面,缩略图之前的标题
我试图编辑商店的首页(我已经设法做产品单页罚款),但无法找到任何地方挂钩出。
基本上,我想要做的就是让产品的标题出现在缩略图之前,并在缩略图之后添加“查看”按钮。
我真的把我的头发拉出来,所以如果有人能帮助我会非常感激!
答
你应该插件/ woocommerce看到/ woocommerce-hook.php
表格行100 - 107
/** * 之前单品摘要股利 * * @see woocommerce_show_product_images() * @ see woocommerce_show_product_thumbnails() */ add_action('woocommerce_before_single_product_summary','woocommerce_show_product_images',20); add_action('woocommerce_product_thumbnails','woocommerce_show_product_thumbnails',20);
/**
表格行120 - 132
/**
* Product Summary Box
*
* @see woocommerce_template_single_title()
* @see woocommerce_template_single_price()
* @see woocommerce_template_single_excerpt()
* @see woocommerce_template_single_meta()
* @see woocommerce_template_single_sharing()
*/
add_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 5);
add_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10);
add_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20);
add_action('woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40);
//add_action('woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50);
/**
第二ARG好运的ADD_ACTION 变化值
更改订单!
答
下面添加上function.php
remove_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
add_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 90);
添加上面的代码会重复你的缩略图,然后添加以下CSS将尽伎俩。
.product-images { display: none; }
您是否将插件模板复制到您的主题并进行了修改?如果不是的话,这在文档中有很好的解释。更好地阅读文档比拉出头发;) – brasofilo
是的,所有的文档都阅读完毕。最好的文档是简短的! – Dave