Forums

wp enqueue script help! (3 posts)

  1. heriz
    Member
    Posted 2 months ago #

    Hi,

    I'm trying to use the wp enqueue script function to get around plugin js conflicts, but I'm afraid javascript doesn't really agree with me. Can anyone help me with this please? I'm trying to convert this code from the Inline MP3 plugin:

    function setplayerscripts() {
    ?>
    <link rel="stylesheet" href="/wp-content/plugins/mp3inline/css/player.css" type="text/css" media="screen" />
    <script type="text/javascript" src="/wp-content/plugins/mp3inline/javascripts/prototype.js"></script>
    <script type="text/javascript" src="/wp-content/plugins/mp3inline/javascripts/domready.js"></script>
    <script type="text/javascript" src="/wp-content/plugins/mp3inline/javascripts/sprintf.js"></script>
    <script type="text/javascript" src="/wp-content/plugins/mp3inline/javascripts/Sound.js"></script>
    <script type="text/javascript" src="/wp-content/plugins/mp3inline/javascripts/Player.js"></script>
    <script type="text/javascript" src="/wp-content/plugins/mp3inline/javascripts/scriptaculous.js"></script>
    <?php
    }
    
    add_action('wp_head', 'setplayerscripts');
    
    ?>

    In this format:

    wp_enqueue_script('prototype', '/wp-content/plugins/mp3inline/javascripts/prototype.js');
    
    wp_enqueue_script('domready', '/wp-content/plugins/mp3inline/javascripts/domready.js');

    etc.

    I have no idea if this is even the correct way of doing it, I'm just in dire need of making Inline MP3 & NextGen work together, and it looks like this is the only way...

    As always, any help much appreciated!

  2. Avram
    Member
    Posted 3 weeks ago #

    I'm having same problem. It just won't work. Here's the code I'm using:

    wp_enqueue_script('pagepeel', '/wp-content/plugins/page-peel/pagepeel-js.php', array(), false, true);

    Tried to hook it in wp_head and wp_footer (I'm trying to add footer script), but it won't work for some reason.

  3. serhanbuy
    Member
    Posted 2 weeks ago #

    Hi,
    I guess, the path of the script must be given in URL format. http://www.........
    Try it this way.

Reply

You must log in to post.

About this Topic