post_excerpt : $post->post_content; $txt = trim( (string) preg_replace( '/\s+/u', ' ', wp_strip_all_tags( strip_shortcodes( $raw ) ) ) ); if ( '' !== $txt ) { return wp_html_excerpt( $txt, 158, '…' ); } } } if ( is_category() || is_tag() ) { $desc = trim( wp_strip_all_tags( term_description() ) ); if ( '' !== $desc ) { return wp_html_excerpt( $desc, 158, '…' ); } } return wp_html_excerpt( (string) $opts['footer_desc'], 158, '…' ); } /** * Injection automatique des balises et OpenGraph. */ add_action( 'wp_head', 'cgt_fha_render_meta_and_og', 2 ); function cgt_fha_render_meta_and_og(): void { $opts = cgt_fha_get_options(); $title = cgt_fha_document_title( wp_get_document_title() ); $description = cgt_fha_get_meta_description(); $og_type = is_single() ? 'article' : 'website'; if ( is_front_page() ) { $url = home_url( '/' ); } elseif ( is_singular() ) { $url = get_permalink() ?: home_url( '/' ); } else { global $wp; $url = home_url( add_query_arg( array(), $wp->request ?? '' ) ); } $og_image = (string) $opts['hero_bg_url']; if ( is_singular() && has_post_thumbnail() ) { $thumb_url = get_the_post_thumbnail_url( get_queried_object_id(), 'cgt-featured' ); if ( $thumb_url ) { $og_image = $thumb_url; } } ?>
Alerte SEO — Indexation bloquée : Votre site demande actuellement aux moteurs de recherche de ne pas l'indexer. Rendez-vous dans Réglages > Lecture et décochez « Demander aux moteurs de recherche de ne pas indexer ce site ».