This file contains hidden or 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
/** | |
* Class Elementor_Form_Email_Attachments | |
* | |
* Send Elementor Form upload field as attachments to email | |
*/ | |
class Elementor_Form_Email_Attachments { | |
// Set to true if you want the files to be removed from | |
// the server after they are sent by email | |
const DELETE_ATTACHMENT_FROM_SERVER = true; | |
public $attachments_array = []; |
This file contains hidden or 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
/* Disable archives pages */ | |
add_action('template_redirect', 'my_disable_archives_function'); | |
function my_disable_archives_function() | |
{ | |
/* Conditional checks examples: | |
is_category() | |
is_tag() | |
is_date() | |
is_author() |
This file contains hidden or 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
/*registering sidebar widget*/ | |
if ( function_exists('register_sidebar') ) | |
register_sidebar(array( | |
'name' => 'Blog Sidebar', | |
'before_widget' => '<div class = "widgetizedArea">', | |
'after_widget' => '</div>', | |
'before_title' => '<h4>', | |
'after_title' => '</h4>', | |
) |
This file contains hidden or 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_action( 'elementor_pro/posts/query/relational-posts', function ( $query ) { $postid = get_the_ID(); $ids = get_post_meta($postid, 'related_featured', true); if ( $ids ) { $query->set( 'post__in', $ids ); } } ); |
This file contains hidden or 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 for post duplication. Dups appear as drafts. User is redirected to the edit screen | |
*/ | |
function rd_duplicate_post_as_draft(){ | |
global $wpdb; | |
if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'rd_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) { | |
wp_die('No post to duplicate has been supplied!'); | |
} | |
/* |
This file contains hidden or 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 defer_parsing_of_js( $url ) { | |
if ( is_user_logged_in() ) return $url; //don't break WP Admin | |
if ( FALSE === strpos( $url, '.js' ) ) return $url; | |
if ( strpos( $url, 'jquery.js' ) ) return $url; | |
return str_replace( ' src', ' defer src', $url ); | |
} | |
add_filter( 'script_loader_tag', 'defer_parsing_of_js', 10 ); |
This file contains hidden or 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 elementor_accordion_title() { ?> | |
<script> | |
jQuery(document).ready(function() { | |
jQuery( '.elementor-accordion .elementor-tab-title' ).removeClass( 'elementor-active' ); | |
jQuery( '.elementor-accordion .elementor-tab-content' ).css( 'display', 'none' ); | |
}); | |
</script> | |
<?php } | |
add_action( 'wp_footer', 'elementor_accordion_title', 99 ); |