<?php
add_action( 'wp_footer', function() {
if ! defined ( 'ELEMENTOR_VERSION' ) ) {
return;
?>
<script>
window.addEventListener('elementor/frontend/init',function() {
elementorfrontend.hooks.addFilter('frontend/handlers/menu_anchor/scroll_top_distance',function(
scrollTop {
return scrollTop 90;
} );
});
</script>
<?php
);
// remove google material icons
add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_script( 'mylisting-material-icons' );
wp_dequeue_style( 'mylisting-material-icons' );
}, 99 );
Dann style.css in child theme bearbeiten:
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("https://xxxxxxxxxx.de/wp-content/embed-google-fonts/material-icons/material-icons-google.eot"); /* IE9 Compat Modes */src:url("https://xxxxxxxxxx.de/wp-content/embed-google-fonts/material-icons/material-icons-google.eot?#iefix") format("eot"),url("https://xxxxxxxxxx.de/wp-content/embed-google-fonts/material-icons/material-icons-google.woff2") format("woff2"),url("https://xxxxxxxxxx.de/wp-content/embed-google-fonts/material-icons/material-icons-google.woff") format("woff"),url("https://xxxxxxxxxx.de/wp-content/embed-google-fonts/material-icons/material-icons-google.ttf") format("ttf"),url("https://xxxxxxxxxx.de/wp-content/embed-google-fonts/material-icons/material-icons-google.svg#Material Icons") format("svg") ;}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}
function ele_disable_page_title( $return ) { return false; }
add_filter( 'hello_elementor_page_title', 'ele_disable_page_title' );
add_action( 'wp_enqueue_scripts', 'my_deregister_scripts', 1000 );
function my_deregister_scripts() {
wp_deregister_script( 'moment-locale-de' );
wp_register_script( 'moment-locale-de', site_url( '/assets/moment.js/de.min.js' , __FILE__ ) );
wp_add_inline_script( 'moment-locale-de', sprintf( 'window.MyListing_Moment_Locale = \'de\';' ) );
}
add_filter('wp_mail_from', 'set_default_from_email');
function set_default_from_email($email){
if($email == 'wordpress@zuchtseite.de')
$email = 'hallo@zuchtseite.de';
return $email;
}
add_filter('wp_mail_from_name', 'set_default_name');
function set_default_name($name){
if($name == 'WordPress'){
$name = 'zuchtseite.de';
}
return $name;
}
add_filter( 'script_loader_src', 'ewp_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', 'ewp_remove_script_version', 15, 1 );
function ewp_remove_script_version( $src ) {
$exceptions = array( 'dynamik', 'monarch' );
foreach ( $exceptions as $item ) {
if ( stripos( $src, $item ) !== FALSE ) {
return $src;
}
}
return remove_query_arg( 'ver', $src );
/* Custom Default Colors for WP Colorpicker */
function theme_name_color_palettes() {
if(wp_script_is('wp-color-picker', 'enqueued') ){
?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery.wp.wpColorPicker.prototype.options = {
palettes: ['#ffffff', '#000000', '#666666', '#287163', '#a1bf36', '#f3f0e9']
};
});
</script>
<?php
}
}
add_action('admin_footer', 'theme_name_color_palettes');
add_action('customize_controls_print_footer_scripts', 'theme_name_color_palettes');