With Insert Headers and Footers Plugin:
With Free Astra Hooks Plugin:
- To add Java script code in the head, use the wp_head location
- To add the code in the footer, use the wp_footer location.
Please visit the plugin page WordPress Repository to download and learn more about this plugin and how it works.
With Custom Layouts module in Astra Pro Addon:
- Enable Custom Layouts Module (screenshot)
- Create New Post (screenshot)
- Enable Code Editor and add your code.
- Replace existing comments and paste your code (screenshot)
- Set other options as per your needs and save.
For most of the websites, configurations as below works great:
- Layout: Hooks
- Action: wp_head or wp_footer depending where you wish to add the code
- Priority: 10
- Spacing: 0
- Display On: Entire Website
- User Roles: All