1. PROMO Upgrade to Pro Membership @ $99 / Lifetime & access all our 16+ premium Divi extensions: Divi Block, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved Custom <head> on single page

Discussion in 'Free Divi Community Forum' started by Blind IT, Oct 4, 2021.

  1. Blind IT

    Blind IT New Member

    We are using an integration with another system that requires custom code in a single page's <html> <head>, where the integration will be used. Since we intend to use that custom integration on more than one page and the code will be different for each instance of the integration (therefore each page we use it on), it can't go in the main theme's <head> code. Someone in a subreddit suggested using a Divi child theme (we use one for the site itself already), but when I activate one, it deactivates the one we use. Is there any way to do this that I'm missing? It can't go in the <body> and must go in the <head>. Thanks.
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade card carousel design for your Divi site without using any plugins:View Demo
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    I don't think there's an easy way to achieve that.

    If inserting your code in a code module doesn't work, then you might want to try the below:

    1. Create a JS file for your code.
    2. Then upload it to your child theme folder: https://www.elegantthemes.com/blog/...text=Creating the JS file in your child theme
    3. Lastly, enqueue the JS file in your child theme functions.php: https://www.elegantthemes.com/blog/...ipts in your Child Theme’s Functions.php file
    **You will need to add necessary PHP conditioning so that it will only load the JS file at specific pages.
     
  3. Blind IT

    Blind IT New Member

    Hi, thanks. I should have updated this. I found a way to do it with another add-on. :)
     
    1. PRO MEMBER PERKS Divi.Help Layout AI Generator - Try the power of AI to generate a custom Divi layout for you:Try Now
  4. bex

    bex New Member

    What plugin did you find? I need to add a specific <script> into the header of a specific page only, and whilst I did find one plugin, the other party said it doesn't work as it needs to be higher up in the <head>
    Thanks!