• I’ve found this code snippet on Codepen. For instance, I wanted to implement the entire code into my website. Later I will decide what slider I wanted to use. The next step will be inserting WP Post content in it.

    But back to the start. I’ve copied the code snippets. The CSS is in my elements.css. The content of the external css-files is also in it. The JS-links are in the header and the html is inserted too (pink area on the site [ redundant link deleted ]). But for some reason, it’s not working yet and I can’t figure out what is causing the problem.

    I hope another pair of eyes can help solving the issue.

    Kind regards,

    Timothy

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey there,

    I checked your site and you have: $ is not defined error which indicates that some of your script calls to jQuery before initialising it or a script conflict. This might be preventing your slider from working.

    Make sure you add jquery to your deps param when enqueuing your custom script. You can check the documentation for more info in – https://developer.ww.wp.xz.cn/reference/functions/wp_enqueue_script/

    Cheers!

    Thread Starter timothy12

    (@timothy12)

    Hi!

    @rollybueno Thanks for your quick reply. I’ve looked at the page you suggested. I’m not well known with JS, but do I have to add the colored code at the top of the page mentionned into my site (somewhere)?

    Regards, Timothy

    Thread Starter timothy12

    (@timothy12)

    Hi again,

    I guess I’ve found the issue. I was adding a js-file in the header.php of the website. I’ve replace that link with the next code in the functions.php.

    wp_enqueue_script( 'deelmobiliteit-mobility-option-slider', get_template_directory_uri() . '/js/mobility-option-slider.js', array(), '20151215', true );

    It seems to work now!

    Thread Starter timothy12

    (@timothy12)

    I was wondering how I could outline the slides so you don’t see the parts of the previous and next slides.

    Kind regards,
    Timothy

    • This reply was modified 1 year, 1 month ago by timothy12.
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Implement Codepen slider code’ is closed to new replies.