I’m attempting so as to add two scripts to the header of my website. I can set up a single script, equivalent to this:
<script sort="textual content/javascript">console.log("testA")</script>
I’m not ready so as to add two scripts, equivalent to these:
<script sort="textual content/javascript">console.log("testA")</script>
<script sort="textual content/javascript">console.log("testB")</script>
I’ve tried the next strategies, and all produce an error:
- Plugin Header and Footer Scripts
- Plugin Insert Headers and Footers
- Plugin Genesis Easy Hooks
- Theme Customizer (Look -> Customise -> Theme Settings -> Header/Footer Scripts)
- Modifying the theme’s features.php utilizing Look -> Theme Editor as this:
add_action('wp_head', 'your_function_name0');
operate your_function_name0(){
?>
<script sort="textual content/javascript">console.log("your_function_0");</script>
<script sort="textual content/javascript">console.log("your_function_1");</script>
<?php
};
The one means I’ve discovered so as to add two scripts is to edit the features.php file externally after which add it to my server.
There could also be some kind of validation occurring. I discover that I can’t add even one script if I don’t specify the sort
attribute or if I enter a <noscript>
tag.
I attempted disabling all plugins by renaming the plugins listing on the file system. That didn’t resolve the problem.
Edit 1/26/2020
Particular Errors
- Plugin Header and Footer Scripts: Web page shows: Inside Server Error 500
- Plugin Insert Headers and Footers: Web page shows: Inside Server Error 500
- Plugin Genesis Easy Hooks: Web page shows: Inside Server Error 500
- Theme Customizer: Web page shows: “Appears to be like like one thing’s gone mistaken. Wait a few seconds, after which attempt once more.” File admin-ajax.php returns Standing 500.
- Theme Editor: Web page shows: “One thing went mistaken. Your change could not have been saved. Please attempt once more. There may be additionally an opportunity that you could be have to manually repair and add the file over FTP.” File admin-ajax.php returns Standing 500.