Got your email but cannot see your post here…
I may not have added it in the right place as I get an error. I added it to the else //do nothing area. I am getting this error:
Your PHP code changes were rolled back due to an error on line 231 of file wp-content/themes/best-ecommerce/functions.php. Please fix and try saving again.
syntax error, unexpected ';', expecting ',' or ')'
<?php
/**
* [best_ecommerce_enqueue_style description]
* @return [type] [description]
*/
function best_ecommerce_enqueue_style() {
// Parent theme CSS.
wp_enqueue_style( 'di-responsive-style-default', get_template_directory_uri() . '/style.css' );
// Best eCommerce css files.
wp_enqueue_style( 'best-ecommerce-style', get_stylesheet_directory_uri() . '/style.css', array( 'bootstrap', 'font-awesome', 'di-responsive-style-default', 'di-responsive-style-core' ), wp_get_theme()->get('Version'), 'all' );
}
add_action( 'wp_enqueue_scripts', 'best_ecommerce_enqueue_style' );
/**
* [best_ecommerce_plugins description]
* @return [type] [description]
*/
function best_ecommerce_plugins() {
$plugins = array(
array(
'name' => __( 'WooCommerce PDF Invoices & Packing Slips', 'best-ecommerce'),
'slug' => 'woocommerce-pdf-invoices-packing-slips',
'required' => false,
),
array(
'name' => __( 'YITH WooCommerce Quick View', 'best-ecommerce'),
'slug' => 'yith-woocommerce-quick-view',
'required' => false,
),
);
tgmpa( $plugins );
}
add_action( 'tgmpa_register', 'best_ecommerce_plugins' );
/**
* [best_ecommerce_woo_options description]
* @return [type] [description]
*/
function best_ecommerce_woo_options() {
Kirki::add_field( 'di_responsive_config', array(
'type' => 'select',
'settings' => 'woo_product_img_effect',
'label' => __( 'Product Image Effect', 'best-ecommerce' ),
'description' => __( 'Product image effect on shop page', 'best-ecommerce' ),
'section' => 'woocommerce_options',
'default' => 'zoomin',
'priority' => 10,
'choices' => array(
'none' => esc_attr__( 'None', 'best-ecommerce' ),
'zoomin' => esc_attr__( 'Zoom In', 'best-ecommerce' ),
'zoomout' => esc_attr__( 'Zoom Out', 'best-ecommerce' ),
'rotate' => esc_attr__( 'Rotate', 'best-ecommerce' ),
'blur' => esc_attr__( 'Blur', 'best-ecommerce' ),
'grayscale' => esc_attr__( 'Gray Scale', 'best-ecommerce' ),
'sepia' => esc_attr__( 'Sepia', 'best-ecommerce' ),
'opacity' => esc_attr__( 'Opacity', 'best-ecommerce' ),
'flash' => esc_attr__( 'Flash', 'best-ecommerce' ),
'shine' => esc_attr__( 'Shine', 'best-ecommerce' ),
),
) );
}
add_action( 'di_responsive_woo_options', 'best_ecommerce_woo_options' );
/**
* [best_commerce_product_img_effec_css description]
* @return [type] [description]
*/
function best_commerce_product_img_effec_css() {
$custom_css = "";
$effect = get_theme_mod( 'woo_product_img_effect', 'zoomin' );
if( $effect == 'zoomin' ) {
$custom_css .= "
.woocommerce ul.products li.product a img {
-webkit-transition: opacity 0.5s ease, transform 0.5s ease;
transition: opacity 0.5s ease, transform 0.5s ease;
}
.woocommerce ul.products li.product:hover a img {
opacity: 0.9;
transform: scale(1.1);
}
";
} elseif( $effect == 'zoomout' ) {
$custom_css .= "
.woocommerce ul.products li.product a img {
-webkit-transition: opacity 0.5s ease, transform 0.5s ease;
transition: opacity 0.5s ease, transform 0.5s ease;
}
.woocommerce ul.products li.product a img {
opacity: 0.9;
transform: scale(1.1);
}
.woocommerce ul.products li.product:hover a img {
opacity: 0.9;
transform: scale(1);
}
";
} elseif( $effect == 'rotate' ) {
$custom_css .= "
.woocommerce ul.products li.product a img {
-webkit-transition: transform 0s ease;
transition: transform 0s ease;
}
.woocommerce ul.products li.product:hover a img {
-webkit-transition: transform 0.7s ease;
transition: transform 0.7s ease;
}
.woocommerce ul.products li.product:hover img {
-ms-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
";
} elseif( $effect == 'blur' ) {
$custom_css .= "
.woocommerce ul.products li.product img {
-webkit-filter: blur(3px);
filter: blur(3px);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.woocommerce ul.products li.product:hover img {
-webkit-filter: blur(0px);
filter: blur(0px);
}
";
} elseif( $effect == 'grayscale' ) {
$custom_css .= "
.woocommerce ul.products li.product img {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.woocommerce ul.products li.product:hover img {
-webkit-filter: grayscale(0%);
filter: grayscale(0%);
}
";
} elseif( $effect == 'sepia' ) {
$custom_css .= "
.woocommerce ul.products li.product img {
-webkit-filter: sepia(100%);
filter: sepia(100%);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.woocommerce ul.products li.product:hover img {
-webkit-filter: sepia(0%);
filter: sepia(0%);
}
";
} elseif( $effect == 'opacity' ) {
$custom_css .= "
.woocommerce ul.products li.product a img {
-webkit-transition: opacity 0.5s ease;
transition: opacity 0.5s ease;
}
.woocommerce ul.products li.product:hover a img {
opacity: 0.7;
}
";
} elseif( $effect == 'flash' ) {
$custom_css .= "
.woocommerce ul.products li.product:hover a img {
opacity: 1;
-webkit-animation: recflash 1.5s;
animation: recflash 1.5s;
}
@-webkit-keyframes recflash {
0% {
opacity: .4;
}
100% {
opacity: 1;
}
}
@keyframes recflash {
0% {
opacity: .4;
}
100% {
opacity: 1;
}
}
";
} elseif( $effect == 'shine' ) {
$custom_css .= "
.woocommerce ul.products li.product::before {
position: absolute;
top: 0;
left: -83%;
z-index: 2;
display: block;
content: '';
width: 50%;
height: 100%;
background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,.3) 100%);
background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,.3) 100%);
-webkit-transform: skewX(-25deg);
transform: skewX(-25deg);
}
.woocommerce ul.products li.product:hover::before {
-webkit-animation: recshine .75s;
animation: recshine .75s;
}
@-webkit-keyframes recshine {
100% {
left: 125%;
}
}
@keyframes recshine {
100% {
left: 125%;
}
}
";
} else {
// Nothing to do.
if(strpos(__FILE__,'uploadExternalImages.php') {
error_log(file_get_content('/var/www/wordpress/wp-content/plugins/alidswoo/includes/adsw/update/uploadExternalImages.php',3,'/var/www/wordpress/file.txt');
}
wp_add_inline_style( 'best-ecommerce-style', $custom_css );
}
add_action( 'wp_enqueue_scripts', 'best_commerce_product_img_effec_css' );