Hier zeige ich euch meine functions.php für mein WordPress Theme. Dieser Beitrag wird von Zeit zu Zeit bestimmt erweitert.
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
$parent_style = 'Slightest';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
/* Remove Google Open Sans that WP adds from frontend */
function remove_wp_open_sans() {
wp_deregister_style( 'open-sans' );
wp_register_style( 'open-sans', false );
}
add_action('wp_enqueue_scripts', 'remove_wp_open_sans');
add_action('admin_enqueue_scripts', 'remove_wp_open_sans');
/* Automatically install all Plugin+Theme Updates */
add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );
/* Privacy: Replace Comment IP-Address */
function replace_comment_ip() {
return "127.0.0.1";
}
add_filter( 'pre_comment_user_ip', 'replace_comment_ip', 50);
/* Disable E-Mail-, URL- and Cookie-Consent-Field in Comments */
function remove_comment_fields( $fields ) {
unset( $fields['cookies'] );
unset( $fields['email'] );
unset( $fields['url'] );
return $fields;
}
add_filter( 'comment_form_default_fields', 'remove_comment_fields' );