Enqueue WordPress Comment Reply Script

This commit is contained in:
2026-09-26 14:04:29 +02:00
parent 087473e67c
commit c60be86dcc
+5
View File
@@ -36,6 +36,11 @@ add_action( 'after_setup_theme', 'c1024_2026_setup' );
function c1024_2026_assets() {
wp_enqueue_style( 'c1024-2026-style', get_stylesheet_uri(), array(), '1.0.0' );
wp_enqueue_script( 'c1024-2026-theme', get_template_directory_uri() . '/assets/js/theme.js', array(), '1.0.0', true );
// Core moves and focuses the reply form and sets its parent comment ID.
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
// Load public assets through WordPress so dependencies and plugin integrations remain ordered.
add_action( 'wp_enqueue_scripts', 'c1024_2026_assets' );