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 dpddg_image_overlay_action( $default_action, $props, $post_id ) { | |
$click_action = get_post_meta($post_id, 'ddg_click_action', true); | |
if(!empty($click_action)) { | |
switch($click_action) { | |
case 'none': | |
return 'none'; | |
case 'custom_link': | |
return 'link'; | |
case 'lightbox': | |
return 'lightbox'; |
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
.add_divi_icon li:before { | |
content: "\e052"; | |
font-family: ETmodules; | |
font-size: 1em; | |
color: green; | |
position: relative; | |
margin-right: 5px; | |
} | |
.add_divi_icon li { |
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
<span class='et-pb-icon' style="font-size: 32px; color: red;"></span> |
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
<?php | |
function my_custom_projects_slug( $slug ) { | |
$slug = array( 'slug' => 'custom-slug' ); | |
return $slug; | |
} | |
add_filter( 'et_project_posttype_rewrite_args', 'my_custom_projects_slug', 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
add_filter( 'dpdfg_custom_sorting_html', 'dpdfg_custom_sorting_html', 10, 2 ); | |
function dpdfg_custom_sorting_html( $sorting_options_html, $props ) { | |
if ( $props['module_id'] === 'custom-sorting' ) { | |
$sorting_options_html = sprintf( ' | |
<div class="dp-dfg-sort-orderby"> | |
<div class="dp-dfg-filters-dropdown closed" data-parent="0"> | |
<p class="dp-dfg-dropdown-label"><span class="dp-dfg-dropdown-placeholder" data-text="%1$s ">%1$s</span></p> | |
<ul> | |
<li class="dp-dfg-sort-option" data-value="date" data-order-value="ASC">%2$s</li> |
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
add_filter( 'dpdfg_ext_set_query_arguments', 'dpdfg_ext_set_query_arguments', 10, 2 ); | |
function dpdfg_ext_set_query_arguments( $query_args, $props ) { | |
if ( isset( $props['module_class'] ) && $props['module_class'] === 'related-recipes' ) { | |
$query_args['post_type'] = 'recipe'; | |
} | |
return $query_args; | |
} |
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_assign_post_year_term($post_id, $post, $update) { | |
// Assign for new posts only | |
if($update) { | |
return; | |
} | |
// Assign only if post type is "post" | |
if ( 'post' !== $post->post_type ) { | |
return; | |
} |
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
/* ONLY RUN THIS FUNCTION ONE TIME */ | |
function dp_set_publish_date_taxonomy_all_posts() { | |
$posts = get_posts(array( | |
'post_type' => 'post', | |
'posts_per_page' => -1, | |
)); | |
foreach ($posts as $post) { | |
$post_id = $post->ID; | |
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) { | |
// get duration custom field | |
$duration = get_post_meta( get_the_ID(), 'duree', true ); | |
$taxonomy1_icon = ''; | |
$taxonomy2_icon = ''; | |
$difficulte_terms = get_the_terms(get_the_ID(), 'difficulte'); | |
if ( $difficulte_terms && ! is_wp_error( $difficulte_terms ) ) { | |
foreach( $difficulte_terms as $term ) { |
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
<script> | |
jQuery(document).ready(function ($) { | |
/* LOAD THE FUNCTION BELOW ON PAGE LOAD */ | |
dfg_trigger_filter_by_term_link(); | |
/* LOAD IT AGAIN AFTER DFG COMPLETES AN AJAX CALL AND THE DOM IS UPDATED */ | |
$(document).on('dfg_after_ajax', function () { | |
dfg_trigger_filter_by_term_link(); | |
}); |
NewerOlder