Custom CSS code 2022
/**Copyright ***NO RIGHT CLICK*** Contenet Protecion CSS Code: **/
* {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Old versions of Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none;
}
/*Page moving left and right while in mobile browser */
html {
overflow-x: hidden;
}
/**logo size on mobile**/
@media only screen and (max-width: 767px) {
body header img#logo {
max-width: 60%!important;
max-height: 60%!important;
height: auto!important;
width: auto!important;
}
}
/**Remove select page from mobile menu**/
#et_mobile_nav_menu span.select_page {
display:none!important;
}
#et_header_style_centered #main-header .mobile_nav {
background-color: transparent!important;
}
@media (max-width: 980px){
.et_header_style_split #main-header .mobile_nav {
background-color: transparent!important;
}
}
/*————- Disply Columns On Mobile—————–*/
@media only screen and (max-width: 980px) {
.two-columns .et_pb_column {
width: 50%!important;
}
}
Copyright ***NO RIGHT CLICK*** Content Protection CSS Code:
/**Copyright ***NO RIGHT CLICK*** Contenet Protecion CSS Code: **/
* {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Old versions of Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none;
}
Logo size on mobile CSS
/**logo size on mobile**/
@media only screen and (max-width: 767px) {
body header img#logo {
max-width: 60%!important;
max-height: 60%!important;
height: auto !important;
width: auto!important;
}
}
Remove the select page from mobile menu
/**Remove the select page from mobile menu**/
#et_mobile_nav_menu span.select_page {
display:none!important;
}
#et_header_style_centered #main-header .mobile_nav {
background-color: transparent!important;
}
@media (max-width: 980px){
.et_header_style_split #main-header .mobile_nav {
background-color: transparent!important;
}
}
Display Columns On Mobile CSS
/*————- Display Columns On Mobile—————–*/
@media only screen and (max-width: 980px) {
.two-columns .et_pb_column {
width: 50%!important;
}
}
Woo Related product php code
//** Related product **//
apply_filters( ‘woocommerce_get_related_product_cat_terms’, wc_get_product_term_ids( $product_id, ‘product_cat’ ), $product_id );
apply_filters( ‘woocommerce_get_related_product_tag_terms’, wc_get_product_term_ids( $product_id, ‘product_tag’ ), $product_id );
Show Related Products Based On Categories Only PHP
//**Show Related Products Based On Categories Only**//
add_filter( ‘woocommerce_product_related_posts_relate_by_tag’, ‘__return_false’ );
Show Related Products Based On Sub-Categories Only PHP
/**
* Only show products in the same sub categories in the related products area
*
* @param $terms - Terms currently being passed through
* @param $product_id - Product ID of related products request
* @return $terms/$subcategories - Terms to be included in related products query
*/
function blz_filter_related_products_subcats_only($terms, $product_id) {
// Check to see if this product has only one category ticked
$prodterms = get_the_terms($product_id, 'product_cat');
if (count($prodterms) === 1) {
return $terms;
}
// Loop through the product categories and remove parent categories
$subcategories = array();
foreach ($prodterms as $k => $prodterm) {
if ($prodterm->parent === 0) {
unset($prodterms[$k]);
} else {
$subcategories[] = $prodterm->term_id;
}
}
return $subcategories;
}
add_filter( 'woocommerce_get_related_product_cat_terms', 'blz_filter_related_products_subcats_only', 20, 2 );
New Show Related Products Based On Sub-Categories Only PHP
// Get Related Products from SAME Sub-category
add_filter( ‘woocommerce_product_related_posts’, ‘my_custom_related_products’ );
function custom_related_products($product){
global $woocommerce;
// Related products are found from category and tag
$tags_array = array(0);
$cats_array = array(0);
// Get tags
$terms = wp_get_post_terms($product->id, ‘product_tag’);
foreach ( $terms as $term ) $tags_array[] = $term->term_id;
// Get categories
$terms = wp_get_post_terms($product->id, ‘product_cat’);
foreach ( $terms as $key => $term ){
$check_for_children = get_categories(array(‘parent’ => $term->term_id, ‘taxonomy’ => ‘product_cat’));
if(empty($check_for_children)){
$cats_array[] = $term->term_id;
}
}
// Don’t bother if none are set
if ( sizeof($cats_array)==1 && sizeof($tags_array)==1 ) return array();
// Meta query
$meta_query = array();
$meta_query[] = $woocommerce->query->visibility_meta_query();
$meta_query[] = $woocommerce->query->stock_status_meta_query();
$meta_query = array_filter( $meta_query );
// Get the posts
$related_posts = get_posts( array(
‘orderby’ => ‘rand’,
‘posts_per_page’ => $limit,
‘post_type’ => ‘product’,
‘fields’ => ‘ids’,
‘meta_query’ => $meta_query,
‘tax_query’ => array(
‘relation’ => ‘OR’,
array(
‘taxonomy’ => ‘product_cat’,
‘field’ => ‘id’,
‘terms’ => $cats_array
),
array(
‘taxonomy’ => ‘product_tag’,
‘field’ => ‘id’,
‘terms’ => $tags_array
)
)
) );
$related_posts = array_diff( $related_posts, array( $product->id ), $product->get_upsells() );
return $related_posts;
}`
Show LinkedIN and YouTube Icons in Divi
But here’s a quick fix. Try the below CSS in Divi > Theme Options > Custom CSS:
.et-social-linkedin a.icon:before { content: '\e09d'; } .et-social-youtube a.icon:before { content: '\e0a3'; }
Disable the WordPress Auto-updates
How to completely disable the WordPress autoupdates
define( ‘AUTOMATIC_UPDATER_DISABLED’, true );
If you want to disable the WordPress autoupdates completely, open the wp-config.php file and add this line to it:
Thank you for taking the time to review our website. We hope you found everything you were looking for. However if you didn’t, please don’t hesitate to contact us via email or phone, whichever is most convenient.
Need Help:
Fill in the form below with your name or nickname, provide an email address for our reply and tell us about your problem. Alternately, send us an email at info@ukdigit.com