我咬过的东西比我能咀嚼更多,需要WooCommerce的帮助 .
我正在尝试编辑商店首页(我已经设法将产品单页做得很好),但无法在任何地方找到挂钩的输出 .
基本上,我所要做的就是让产品的 Headers 出现在缩略图之前,并在缩略图之后添加“视图”按钮 .
我真的把头发拉了出来,所以如果有人能帮忙我会非常感激!
你应该在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的值
祝好运!
在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; }
2 回答
你应该在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行
/ **
更改add_action的顺序更改第二个arg的值
祝好运!
在function.php上添加以下内容
添加上面的代码将复制你的缩略图,然后添加下面的CSS会做的技巧 .