Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
load javascript only in a section from a web page

I am using wordpress and I need to load a custom javascript only in a specific section of my webpage by callign its ID.
Is it possible ?
for now the js is loading in the whole page and there were conflicts with my theme

here is my code:



function my_custom_scripts() {
        


          //  wp_enqueue_script( 'jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js', array('jquery'), NULL, true );  
         

            wp_enqueue_script( 'gsap', 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js', array('jquery'), NULL, true );  
        
            wp_enqueue_script( 'scrollTrigger', 'https://assets.codepen.io/16327/ScrollTrigger.min.js?v=32', array('jquery'), NULL, true );
            
            wp_enqueue_script( 'smooth', 'https://cdnjs.cloudflare.com/ajax/libs/smooth-scrollbar/8.5.2/smooth-scrollbar.js', array('jquery'), NULL, true );

            wp_enqueue_script( 'custom-js', get_stylesheet_directory_uri() . '/custom.js', array( 'jquery' ),'',true );

        
    }
    add_action( 'wp_enqueue_scripts', 'my_custom_scripts' );```
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!