Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda