Support » Plugin: ElementsKit Elementor Addons and Templates Library » How to add Custom JS script in Header with Header Builder

  • Hello,

    I build Header with Elementskit header builder now I need to add some JS code in the header file. But when building a header with Elementskit then the theme header doesn’t load. So can not add a script.

    Is there any way I can add the JS script?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @mamunnu ,

    You can add any custom JS in your header in 2 ways that is built with ElementsKit Header Footer Builder. I am explaining the process below –

    1. You can use WordPress default header hook to inject your custom scripts in the header. Use the below code in your functions.php file.

    // Push script code inside the head tag
    function your_custom_script(){
       ?>
        <script>
    
           // your custom script here
        
        </script>
        <?php
    }
    add_action('wp_head', 'your_custom_script', 99);

    2. You can use this popular plugin as well to inject your custom scripts in the header.

    After following the above solutions if you have any query or need clarification, please let me know. I will be glad to help you.

    Regards,
    Benjir

    Hi @mamunnu ,

    We haven’t heard from you since the last reply. Did you find the solution you’re looking for by using the above methods? Let us know the update.

    Regards,
    Benjir

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add Custom JS script in Header with Header Builder’ is closed to new replies.