I want the core file wp-comments-post.php in wordpress to load my custom css and js files. What hook to use to enqueue those files?
Asked
Active
Viewed 102 times
0
-
You want [this function](https://developer.wordpress.org/reference/functions/wp_enqueue_style/) – Jamie_D Jan 04 '20 at 13:10
-
And [this one](https://developer.wordpress.org/reference/functions/wp_enqueue_script/) to load javascript files – Jamie_D Jan 04 '20 at 13:13
-
Thats is correct. I am looking for a hook to load them, since the default wp_enqueue_scripts does not work with that particular page. – Jan 04 '20 at 13:26
-
The enqueue functions should be added to your theme's **functions.php** file. Any file within Wordpress that has `require( dirname( __FILE__ ) . '/wp-load.php` )' will have those functions available – Jamie_D Jan 04 '20 at 13:40
-
+ you can use `if` `is_page` to load styles/scripts only on pages where these are needed. – Fresz Jan 04 '20 at 15:28