__( 'Menu accueil', 'sbv' ), ) ); /* * Switch core wordpress pour les formulaires * pour les valider en HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); } // FONCTION DE DETECTION JS function monTheme_js_detection() { echo "\n"; } add_action( 'wp_head', 'monTheme_js_detection', 0 ); // FONCTION POUR LIER LES FICHIER CSS ET JS A WORDPRESS function monTheme_ajout_scripts() { // Charger style.css wp_enqueue_style( 'style', get_template_directory_uri().'/style.css' ); wp_enqueue_style( 'fontAwesome', get_template_directory_uri().'/css/font-awesome.css' ); // Charger un fichier js wp_enqueue_script( 'gmaps', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', false ); wp_enqueue_script( 'app', get_template_directory_uri() . '/js/app.js', false ); } add_action( 'wp_enqueue_scripts', 'monTheme_ajout_scripts' ); function custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); function ld_advanced_custom_field_in_feed($content) { if(is_feed()) { $post_id = get_the_ID(); $rsscontenu1 = get_field('contenu_1'); $rssimage = get_field('image'); $theContent =array( "content"=>$content, "contenu_1"=>$rsscontenu1, "image" =>$rssimage ); $content = json_encode($theContent); // $content = 'toto'; } return $content; } add_filter('the_content','ld_advanced_custom_field_in_feed'); /** * Set post type to 'page' if it was requested. * * @param object $query * @return void */ function t5_pages_in_feed( &$query ) { if ( isset ( $_GET['post_type'] ) && $_GET['post_type'] === 'page' && is_feed() ) { $query->set( 'post_type', 'page' ); } } add_action( 'pre_get_posts', 't5_pages_in_feed' );