1

我咬得比我能咀嚼的还多,需要一些关于 WooCommerce 的帮助。

我正在尝试编辑商店首页(我已经设法将产品单页做得很好),但在任何地方都找不到挂钩的输出。

基本上,我要做的就是让产品的标题出现在缩略图之前,并在缩略图之后添加一个“查看”按钮。

我真的把我的头发拉了出来,所以如果有人能帮助我,我将非常感激!

4

2 回答 2

0

您应该在 plugin/woocommerce/woocommerce-hook.php 中看到

表格第 100 - 107 行

/** * 单个产品摘要 Div 之前 * * @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 );

/**

add_action 的更改顺序 更改第二个 arg 的值

祝你好运!

于 2014-01-13T08:03:43.610 回答
0

在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; }
于 2017-07-21T03:40:45.960 回答