DIVI默认侧边栏简单美化外观CSS
/* 侧边栏CSS */
.et_pb_widget ul li {
background-color: #f9f9f9;
padding: 10px;
padding-top: 11px;
padding-bottom: 11px;
padding-left: 20px;
}
WordPress默认表格无边框添加CSS
/*表格边框*/
table,th,td{
border-collapse:collapse;
border:1px solid black;
}
DIVI 删除文本模块中的表格边框
/DIVI 删除文本模块中的表格边框*/
.et_pb_text table, .et_pb_text table tr, .et_pb_text table td {
border: none!important;
}
DIVI 产品画廊模块图片显示正方形
/DIVI产品禁止横向或纵向裁剪图片*/
add_filter( ‘et_pb_gallery_image_width’, ‘custom_image_width’ );
function custom_image_width($width) {
return ‘9999’;
}
add_filter( ‘et_pb_gallery_image_height’, ‘custom_image_height’ );
function custom_image_height($height) {
return ‘9999’;
}
add_image_size( ‘custom-image-size’, 9999, 9999, array( ‘center’, ‘center’ ) );
其中999代表原始图片大小,不裁剪。
如果已经上传的图片,使用插件重新生成缩略图。
DIVI主题删除博客特色图片中的负边距
/*删除博客特色图片中的负边距*/
.et_pb_image_container {
margin: 0px;
}
Divi商店页面添加“添加到购物车”按钮
用商店模块创建的商店页面中的产品没有“添加到购物车”按钮,将此代码添加到子主题的functions.php 文件中。
// Add “Add to Cart” buttons in Divi shop pages
add_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 20 );