Skip to content

Instantly share code, notes, and snippets.

@divienginesupport
divienginesupport / de-mobile_blur_background.css
Created April 19, 2023 09:42
Divi Mobile Snippet - Blur the background when the Divi Engine style menu is open
/* Add a blur effect when the Hamburger Menu is open */
/* Target the element with ID 'page-container' when the parent element has class 'show-menu' */
.show-menu #page-container {
/* Apply a 10-pixel blur effect to the element */
-webkit-filter: blur(10px); /* For WebKit browsers (e.g., Safari) */
-moz-filter: blur(10px); /* For Mozilla browsers (e.g., Firefox) */
-o-filter: blur(10px); /* For Opera browsers */
-ms-filter: blur(10px); /* For Microsoft browsers (e.g., Internet Explorer) */
filter: blur(10px); /* Standard filter property for modern browsers */
@divienginesupport
divienginesupport / de-mobile_show_theme_builder_header.css
Created April 19, 2023 09:40
Divi Mobile Snippet - Show the Theme Builder global header also when mobile breakpoint is set to 5000px
/* Show Theme Builder header on all screens */
/* The following media query targets screens with a maximum width of 5000 pixels */
@media only screen and (max-width: 5000px) {
/* Ensure that the header (with class 'et-l--header') is visible */
body .et-l--header,
/* Ensure that the navigation (with ID 'et-navigation') is visible */
body #et-navigation {
display: block !important; /* Use '!important' to override other styles */
}
@divienginesupport
divienginesupport / de-icon_font_icon_styling.css
Created April 19, 2023 07:40
CSS to style Divi Font Icons that have the class .de-icon
/* Styling for the .de-icon class used in some of our WooCommerce snippets */
.de-icon {
/* Set the color of the icon */
color: #0fe5a8 !important;
/* Set the font family for the icon */
font-family: "ETmodules";
/* Prevent the icon from being read by screen readers */
speak: none;
@divienginesupport
divienginesupport / de-woocommerce_cart_amount_shortcode.php
Last active April 19, 2023 09:36
WooCommerce Snippet - Shortcode for displaying a cart icon with the total amount in the cart next to it
/**
* Shortcode for displaying a WooCommerce cart icon with the cart total.
* The cart icon is linked to the WooCommerce cart page.
* Shortcode tag: [divi_engine_cart_icon]
*
* Make sure to add this CSS also https://gist.github.com/divienginesupport/ea2d56f435c94ca7607c243b9c8d829e
*
*/
function divi_engine_cart_icon_shortcode() {
@divienginesupport
divienginesupport / de-woocommerce_login_shortcode.php
Last active April 19, 2023 09:36
WooCommerce Snippet - Shortcode for My Account text if user is logged in, or Login/Register if not
/**
* Shortcode function for generating a link to the "My Account" page if the user is logged in,
* or to the "Register/Login" page if the user is not logged in.
*
* You can pass it a code from the Divi Icon Font for the icon to use
* -> https://www.elegantthemes.com/blog/resources/elegant-icon-font
*
* Shortcode tag: [de_login_register_link icon="e08a"]
*
* Make sure to add this CSS also https://gist.github.com/divienginesupport/ea2d56f435c94ca7607c243b9c8d829e
// This filter will work for contact from conditional recipients. The custom_contact_recipient is the function name.
add_filter('df_contact_recipient', 'custom_contact_recipient', 10, 3);
// Use this filter will work for my create post form type. The custom_form_recipient is the function name
add_filter('df_notification_recipient', 'custom_form_recipient', 10, 3);
// This is the function for the contact form
function custom_contact_recipient( $mail_to, $form_id, $form_data ) {
/*** Your conditions go here ***/
// Use this filter if your form type is a contact form
add_filter('df_contact_recipient', 'custom_contact_recipient', 10, 3);
// Use this filter if your form type is anything else
add_filter('df_notification_recipient', 'custom_contact_recipient', 10, 3);
function custom_contact_recipient( $mail_to, $form_id, $form_data ) {
// Enter your form ID here
if ( $form_id == 'add_post_form' ) {
// These are the field conditions. We enter the field ID here and the expected value
// First condition checks if the Department field is equal to Sales and the Products field is equal to Form Builder
if ( $form_data['department'] == 'Sales' && $form_data['products'] == 'Form Builder' ) {
$mail_to = '[email protected]';
} else if ( $form_data['department'] == 'Sales' && $form_data['products'] == 'Bodycommerce' ) {
$mail_to = '[email protected]';
function custom_contact_recipient( $mail_to, $form_id, $form_data ) {
// Enter your form ID here
if ( $form_id == 'add_post_form' ) {
// These are the field conditions. We enter the field ID here and the expected value
if ( $form_data['department'] == 'Sales' ) {
$mail_to = '[email protected]';
} else if ( $form_data['department'] == 'Support' ) {
$mail_to = '[email protected]';
}
}
function custom_contact_recipient( $mail_to, $form_id, $form_data ) {
// Enter your form ID here
if ( $form_id == 'add_post_form' ) {
// These are the field conditions. We enter the field ID here and the expected value
// First condition checks if the Department field is equal to Sales and the Products field is equal to Form Builder
if ( $form_data['department'] == 'Sales' && $form_data['products'] == 'Form Builder' ) {
$mail_to = '[email protected]';
} else if ( $form_data['department'] == 'Sales' && $form_data['products'] == 'Bodycommerce' ) {
$mail_to = '[email protected]';