Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #859446

    Hi Enfold Team,

    Sorry if this has been asked, but am curious, I want to test this jquery barcode gen

    but i’m not sure how to go about adding this.

    Do i need to just upload the JS files and then ref call them, or should i add the following code to my Functions.php file of my child theme and then paste the js in there?

    function add_custom_script(){
    ?>
    <script>
    PASTE YOUR CODE HERE 
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Thanks

    #859923

    Hey Drebosio,

    What code should go where exactly?

    Best regards,
    Rikard

    #860227

    Hi Rikard,

    So in the link above you can see there is a demo. However you can DL the files and they provide 2 js files.

    this is the code i’m referencing ^

    I’m not sure where to put these.

    In the code i added in my 1st post, i found that from another post but i’m not sure if it will work for this instance, my knowledge with jquery/js is limited unfortunately :(

    #860245

    well this is something i would do via enqueue scripts:

    download those files ( so long you do not edit the code – take the minified one)
    upload it to your child-theme/js folder and do this to your functions.php file of your child-theme

    function include_barcode_js_file() {
       wp_enqueue_script( 'barcode', get_stylesheet_directory_uri().'/js/jquery-barcode.min.js', array('jquery'), 2, true );
    }
    add_action( 'wp_enqueue_scripts', 'include_barcode_js_file', 100 );

    but would you accept to do with it? – it is not a plugin. its just pur script code?

    #860487

    Hi Drebosio,

    Please try out the suggestion posted by @guenni007, it should work out.

    Best regards,
    Rikard

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.