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

161
Views
core-js wordpress integration

I was used to integrating core-js via html, which does not seem to work in new versions.

In particular I am trying to implement the core library in a wordpress installation, without great results.

This is how I try to integrate core-js in functions.php:

wp_enqueue_script('core-js','https://cdnjs.cloudflare.com/ajax/libs/core-js/3.22.5/minified.js');
wp_enqueue_script('custom-js', get_stylesheet_directory_uri() . '/js/custom.js');

And this is my script:

var CustomizeColors = {
    init: function(){
        var blocks = document.getElementsByClassName("block-title td-block-title");
        for(i=0; i<blocks.length; i++ ){
            if(i%2 == 0){
                blocks[i].addClass("red");
            }
            else{
                blocks[i].addClass("blue"); 
            }
        }
    }
}
Core.start(CustomizeColors);

In console i get:

"custom.js?ver=5.9.3:14 Uncaught ReferenceError: Core is not defined"

Can someone help me?

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!