• This might be a silly question since I’m really new at this. Can someone please tell me how to include this script tag inside of my plugin file? I know that I should use enqueue_script to link a js file, but this one is just a piece of code for a jQuery plugin that I want to turn into a customizable WP plugin. Should I insert it as part of $content?

    <script type=”text/javascript”>
    addthis.layers({
    ‘theme’ : ‘gray’,
    ‘share’ : {
    ‘position’ : ‘left’,
    ‘numPreferredServices’ : 5
    }
    });
    </script>

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Hook into either ‘wp_head’ or ‘wp_footer’ actions, depending if you want it in the head section or at the end of the file. From you action callback, just echo the entire thing and it’ll show up in the head or footer of every page.

Viewing 1 replies (of 1 total)
  • The topic ‘Script tag for jQuery in plugin files’ is closed to new replies.