<?php
// Chargement des css 
function theme_enqueue_styles() { 
	wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); 
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );

// Redirection des pages 404
function wpm_404_redirect(){
    if( is_404()){
        wp_redirect( home_url() );
        exit;
    }
}
add_action( 'template_redirect', 'wpm_404_redirect' );

// Ajout d'une nouvelle taille d'image
// nommée "image-recette" de 600px de large
//
add_action( 'after_setup_theme', 'wpm_image_recette' );
function wpm_image_recette() {
    add_image_size( 'image-recette', 600 );
}
// Ajout dans la liste des tailles d'images
//
add_filter('image_size_names_choose', 'wpm_image_sizes');
function wpm_image_sizes($sizes) {    $addsizes = array(    "image-recette" => __( "Image Recette")    );    $newsizes = array_merge($sizes, $addsizes);    return $newsizes;}
/* ******************************************************************* */
// ENVOI DE MAILS via Formulaires de contact 
// Function to change email address
function bpc_sender_email( $original_email_address ) {
    return 'contact@heracles-debarras.fr';
}

// Function to change sender name
function bpc_sender_name( $original_email_from ) {
	return 'www.heracles-debarras.fr';
}

// Hooking up our functions to WordPress filters 
add_filter( 'wp_mail_from', 'bpc_sender_email' );
add_filter( 'wp_mail_from_name', 'bpc_sender_name' );
/* ******************************************************************* */

?>