This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dpdfg_custom_loader() { | |
ob_start(); | |
?> | |
<div class="dp-dfg-loader"><div class="my_custom_loader"></div></div> | |
<style> | |
.dp-dfg-loader { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
margin-top: -30px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dpdfg_custom_loader() { | |
ob_start(); | |
?> | |
<div class="dp-dfg-loader">[insert your loader HTML here]</div> | |
<style> | |
/* ADD YOUR LOADER'S CSS HERE */ | |
</style> | |
<?php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dpdfg_after_read_more() { | |
return '<a class="button et_pb_button" href="#">Click Me</a>'; | |
} | |
add_filter('dpdfg_after_read_more', 'dpdfg_after_read_more'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dpdfg_after_read_more($content, $props) { | |
if (isset($props['module_id']) && $props['module_id'] === 'custom-content') { | |
return '<a class="button et_pb_button" href="#">Click Me</a>'; | |
} else { | |
return 'This module does not have CSS ID custom-content'; | |
} | |
} | |
add_filter('dpdfg_after_read_more', 'dpdfg_after_read_more', 10, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dpdfg_after_read_more() { | |
ob_start(); | |
echo do_shortcode('[your_shortcode_handle]'); | |
return get_ob_clean(); | |
} | |
add_filter('dpdfg_after_read_more', 'dpdfg_after_read_more'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dp_ocp_custom_content() { | |
return '<a class="button et_pb_button" href="#">Click Me</a>'; | |
} | |
add_filter('dp_ocp_custom_content', 'dp_ocp_custom_content'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dp_ocp_custom_content() { | |
$custom_field = get_post_meta( get_the_ID(), 'my_custom_field', true ); | |
return '<a class="button et_pb_button" href="#">'.$custom_field.'</a>'; | |
} | |
add_filter('dp_ocp_custom_content', 'dp_ocp_custom_content'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dp_ocp_custom_content($content, $props) { | |
if (isset($props['module_id']) && $props['module_id'] === 'custom-content') { | |
return '<a class="button et_pb_button" href="#">Click Me</a>'; | |
} else { | |
return 'This module does not have CSS ID custom-content'; | |
} | |
} | |
add_filter('dp_ocp_custom_content', 'dp_ocp_custom_content', 10, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dpdfg_default_post_types($default_post_type) { | |
return array_merge($default_post_type, array('page' => get_post_type_object('page'))); | |
} | |
add_filter('dpdfg_default_post_types', 'dpdfg_default_post_types'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DFG CUSTOM CONTENT FILTER | |
function dpdfg_after_read_more_custom_content($content, $props){ | |
// Apply this only to Divi FilterGrid modules with class "products" set in the module's Advanced tab | |
if (isset($props['module_class']) && $props['module_class'] === 'products') { | |
global $product; | |
if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) { | |
// Get the necessary classes | |
$class = implode( ' ', array_filter( array( |
OlderNewer