• I want to use the wp_enqueue_script. Can someone help me out?
    I have to do is replaced the :

    <script src=”<?php echo get_bloginfo(“template_url”); ?>/light/jquery.prettyPhoto.js” type=”text/javascript” charset=”utf-8″></script>

    with

    <?php wp_enqueue_script( ‘lightbox’ ); ?>

    in the head of the header.php file before wp-head()?

    Please check my method:

    I applied wp_enqueue_script in function.php file

    <?php
    function my_init_method() {
    wp_register_script( ‘lightbox’, ‘wp-content/themes/light/jquery.prettyPhoto.js’);
    wp_enqueue_script(‘lightbox’);
    }
    add_action(‘init’, ‘my_init_method’);
    ?>

    Now calling this function from header.php like

    <?php wp_enqueue_script(“lightbox”); ?>

    but its create issue and stop all scripts working also…

    Please help

    Regards
    Ibrar

Viewing 1 replies (of 1 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Sorry, this forum does not provide support.
    Try the How-To forum.

    When posting code, you should use backticks to wrap code in. Alternatively, press the (code) button above your post textbox.

Viewing 1 replies (of 1 total)

The topic ‘issue wp_enqueue_script’ is closed to new replies.