add-ons – Add Codepen animation as Preloader to WordPress


1) In what location should I add the codepen HTML code?

If you are using a secondary theme, for example, you can copy the main theme header.php file in your child's theme directory and add the required html to that file after .

If you are developing your own theme, place the marking where you want.

Or you can also add the markup with an action hook (for example, wp_footer or item-specific action hook, if available). This could be added to your theme functions.php file or a custom add-in file. Something in this sense,

add_action (& # 39; wp_footer & # 39 ;, & # 39; prefix_my_preloader & # 39;); // or another suitable template hook
prefix_my_preloader () {function
?>
    
<? php }

2) In what location should I add the given CSS?

Styles can be added to your theme (child) styles.css file, the additional css section of the Customizer (if available, but perhaps not the best option), or a custom css file that is in your theme (child) or in the custom add-ons directory. Remember to include the styles if you are using a custom css file.

3) And in what location should I add any JS required for it to work
as it happens here

The scripts can be added to your theme (child) scripts.js or a customized js file that is found in your theme (child) or in the custom add-ons directory. Remember to include the scripts if you are using a custom js file.

P.S.
You can also add styles and scripts with custom functions using the action hooks that are mentioned in the accepted response to Add CSS animation as Preloader to WordPress. Then you will add these functions to your theme (secondary) functions.php or a custom add-in file.