我正在使用Woocommerce与我开发的可湿性粉剂主题。我需要添加一个类到产品页面上的Woocommerce div,以获得Woocommerce内容,以适应我的网站容器。
我是Wordpress/ Woocommerce的新手。
有没有人能建议我怎么做?
我只需要改变
<div class="woocommerce"> to <div class="container woocommerce">谢谢
尼尔
发布于 2018-08-08 22:21:02
要做到这一点,最好的方法是复制默认的WooCommerce模板文件,然后为您自己的主题创建它们;有很多与此相关的文档。
https://docs.woocommerce.com/document/template-structure/#
Edit files in an upgrade-safe way using overrides. Copy the template into a directory within your theme named /woocommerce keeping the same file structure but removing the /templates/ subdirectory.
Example: To override the admin order notification, copy: wp-content/plugins/woocommerce/templates/emails/admin-new-order.php to wp-content/themes/yourtheme/woocommerce/emails/admin-new-order.php
发布于 2018-08-08 22:23:47
有两个选项可以添加类1.搜索特定div/类到woocommerce文件夹2.通过jQuery添加
$(‘.woocommerce’)容器(‘.addClass’);
如果您页面中有多个woocommerce类,请从父类继承该类。
例如:-
$('parentUniqueSelector .woocommerce‘)容器(’.addClass‘);
有关更多详细信息,请共享托管链接或示例代码。
发布于 2019-05-23 03:56:31
在我的例子中,我使用的是Bootstrap4框架,为了将.row类应用到“我的帐户”页面中的woocommerce div,我简单地使用了-.row()混合,例如:
.woocommerce-account{
.woocommerce{
@include make-row();
}
}你也可以使用make-container()混入,这取决于你的项目需要。
更多信息here
https://stackoverflow.com/questions/51748901
复制相似问题