Skip to content

Instantly share code, notes, and snippets.

/* Add Show/Hide Add to Cart button option */
if ( ! function_exists( 'de_append_theme_customizer' ) ) {
function de_append_theme_customizer( $wp_customize ) {
$wp_customize->add_setting( 'et_divi[add_to_cart]', array(
'type' => 'option',
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'wp_validate_boolean',
) );
$wp_customize->add_control( 'et_divi[add_to_cart]', array(
/* Ajax Add to Cart button */
if ( ! function_exists( 'de_add_to_cart_button' ) ) {
function de_add_to_cart_button(){
if ( true === et_get_option( 'add_to_cart', false ) ) {
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 20 );
}
}
add_action( 'init', 'de_add_to_cart_button' );
}
/* Grid Extended 1 */
@media screen and (min-width: 981px) {
.ge1 .et_pb_post_extra.el_dbe_grid_extended .post-content {
order: 0;
width: 66% !important;
}
.ge1 .et_pb_post_extra.el_dbe_grid_extended .post-media {
width: 34% !important;
@elicus
elicus / Text over an image on hover.css
Created November 20, 2020 06:38
Text over an image on hover
.clip-image-hover p {
transition: background-image 300ms ease 0ms;
background-repeat: no-repeat;
background-position: left;
background-size: cover;
-webkit-background-clip: text;
-webkit-text-fill-color: #FFFFF;
}
.clip-image-hover p:hover {
.modal-example-1 .el-icon span.dipl_modal_trigger_element.dipl_modal_trigger_icon.et-pb-icon:before {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
background: #eeeeee;
border-radius: 50%;
opacity: 1;
@elicus
elicus / gist:fc0248afc1c0fe848b23fd1076b850fe
Created June 30, 2020 06:48
Swap Postion of Currency and Price in the Divi Restro Menu
.el-drm-menu-item-price {
display: flex;
flex-direction: row-reverse;
}
@elicus
elicus / gist:6893b3852547fd2b838f3253bbe9a36e
Created June 2, 2020 05:20
SQL Query to Change URL of WordPress Installation Manually
UPDATE wp_options SET option_value = replace(option_value, 'oldurl.com', 'newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';UPDATE wp_posts SET guid = replace(guid, 'oldurl.com','newurl.com');UPDATE wp_posts SET post_content = replace(post_content, 'oldurl.com', 'newurl.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'oldurl.com','newurl.com');
@elicus
elicus / change-all-items-text-in-divi-restro-menu
Created May 15, 2020 16:42
Change text for "All Items" in Divi Restro Menu Plugin. Add the following code to the Divi Theme Options >> Integrations >> Add Code to the Head of your Blog
<script>
jQuery(window).load(function(){
jQuery('.el-drm-menu-items-categories').find('li[data-id=""]').text('Custom text');
});
</script>
UPDATE wp_options SET option_value = REPLACE (option_value, 'http://www.YOUR-OLD-DOMAIN.com', 'http://www.YOUR-NEW-DOMAIN.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.YOUR-OLD-DOMAIN.com','http://www.YOUR-NEW-DOMAIN.com');
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://www.YOUR-OLD-DOMAIN.com','http://www.YOUR-NEW-DOMAIN.com');
<?php
if ( ! function_exists( 'de_woo_email_social_icons' ) ) {
function de_woo_email_social_icons( $icons ) {
echo '<ul class="de-social-icons">
<li><a href="#" target="_blank"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
<li><a href="#" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
<li><a href="#" target="_blank"><i class="fa fa-linkedin" aria-hidden="true"></i></a></li>
<li><a href="#" target="_blank"><i class="fa fa-instagram" aria-hidden="true"></i></a></li>
</ul>