Support » Fixing WordPress » how to add scripts to plugin?

  • MatthewRuddy


    Hi. I am trying to add scripts and styles to my first wordpress plugin.

    Currently, I am using add_action(‘wp_head’,’easing_head’) then using php include to include both the css and javascript files. However, this prints them on the page source, which I don’t want.

    The the function easing_head has many variables in it [such as $source = get_option(‘source’)] and using wp_enqueue_script or wp_enqueue_style means the scripts are loading but the variables no longer work which is needed for it to display correctly.

    These variables contain information set by the user, such as the height, width, colour, in the CSS. These are set by the user in the admin control panel.

    The page in question is I simple wish to include the scripts and styles without actually printing them on the source, with the variables still continuing to function. Is this possible?

  • The topic ‘how to add scripts to plugin?’ is closed to new replies.