Before you ask please READ THIS

Load CSS and javascript in WordPress Child Themes

in Chillout Posts: 2
Hello,
I need to load css and javascript files.

In the folder child I have function.php file, with the following code:

function ponerEnColaCargaFicheros() {
wp_enqueue_style( 'jshowoff', 'http://fabricanet.com/clientes/cd/wp-content/rafa/jshowoff.css');
wp_enqueue_script( 'jquery.min', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js', array(), '1.0.0', true );
wp_enqueue_script( 'jquery.jshowoff.min', 'http://fabricanet.com/clientes/cd/wp-content/rafa/jquery.jshowoff.min.js', array(), '1.0.0', true );
wp_enqueue_script( 'servicio', 'http://fabricanet.com/clientes/cd/wp-content/rafa/servicio.js', array(), '1.0.0', true );
}

add_action( 'wp_enqueue_scripts', 'ponerEnColaCargaFicheros' );

But do not load the page, all the time remaining in the preload.

As I can do to load these files using the child theme?

thank your
Rafa

Comments

  • Posts: 1,758
    Hello there!

    You have few JavaScript errors visible in the console:

    1.
    TypeError: $ is not a function
    http://www.fabricanet.com/clientes/cd/
    Line 386
    $(document).ready(function(){ $('#slidingFeatures').jshowoff({

    2.
    TypeError: $ is not a function
    http://www.fabricanet.com/clientes/cd/
    Line 434
    $(document).ready(function(){ $('#servicioFeatures').jshowoff({

    Those are preventin page form complete load.

    Is it something You wrote? This can be a custom JS code inside Revolution Slider.
    Remember to rate our theme if you like it ;)
    All the Best.
  • Posts: 2
    Hello,
    these codes work well:
    $ (document) .ready (function () {$ ('# slidingFeatures'). jshowoff ({
    $ (document) .ready (function () {$ ('# servicioFeatures'). jshowoff ({

    If I hit load files directly in header.php it works perfectly.

    Why to load them from the child theme does not work?

    thanks
  • Posts: 1,758
    Hello,
    I would have to have an opportunity to look at the code You've made. Otherwise I just can't give You procise answer.
    Remember to rate our theme if you like it ;)
    All the Best.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion