Put that script into a file somewhere in your theme folder. Include it using the following code in your theme’s functions.php file:
<?php
function wpa_65602_enqueue_scripts() {
wp_enqueue_script( 'facebook', get_bloginfo( 'template_url' ) . '/path/to/script.js' );
}
add_action( 'wp_enqueue_scripts', 'wpa_65602_enqueue_scripts' );
Related Posts:
- How can I see all the actions attached to an “add_action” hook?
- How to include code only on specific pages?
- Changing the “Plugin Activated” Message Default
- Schedule WordPress Auto-Updates to only run during business hours
- Remove action from plugin on other plugin
- How To Determine If A Filter Is Called In A Sidebar/Widget Context?
- Is there any debug toolbar that shows whick hooks are called for the current page in WordPress?
- When can you get current page ID and initialize hooks right after?
- Can we hook a static method of a class to add_action inside that class?
- What is the ‘admin_action_’ . $_REQUEST[‘action’] hook used for?
- Filter out results from REST API
- How can I remove a hooked action created by a plugin?
- WordPress admin notice in plugin function
- Using the ‘draft_to_publish’ hook (post status transition)
- Filter Hook on plugin update
- WordPress Hook that will run when media file deleted
- Disallow a user to post in certain categories
- Intercepting a add_action
- Generic plugin (de)activation hook?
- disable active plugins for specific theme
- Adding a form at the end of the content
- Find out if request is for custom post type archive before query runs
- Use external link in the add sub menu
- Failed to invoke other hook from the init hook
- How can I add a custom meta value on file upload?
- How can I filter blog name?
- Is it possible to remove this action? (as it’s added just before it’s called)
- Woocommerce Shipping module available only for type of products [closed]
- WordPress Plugin Boilerplate – add_action hook in static “activate” function
- Determine plugin name from within plugin_action_links filter
- How to prevent action in ajax request, when in admin side?
- Easy Digital Downloads (EDD) – Purchase Receipt emails couldn’t be logged
- Placement of Code in Plugin for hooking `save_post`
- Can I use a method from an existing plugin as an action hook?
- Reposition Woocommerce Message
- How to initialize something in unit test before the init hook being called?
- ‘wp_login’ action hook not working with wp-login.php file
- Prevent a plugin from being automatically activated
- Where (or when) should I register a new taxonomy?
- How get a value from a plugin into another plugin through action/filter
- Hook (or other way) to find out when another plugin is activated / installed
- Any hook for pre-plugin-update -either bulk or single plugin update
- Inserting above the comment template
- Insert new user with form submit ‘init’ hook
- How do I display only the latest post on my home page, while maintaining proper plugin hooks?
- Modifying the comments section through a plugin regardless of theme
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- wp_get_post_terms is difference obj model than the one in rest api response
- Get Time Taken By Each Action Hook in WordPress
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Best place for short bio,image and button [closed]
- password_reset hook is not working
- The Hook registration_errors was not called
- edit_user_profile and show_user_profile are not firing inside a class
- Template filter for custom taxonomy terms
- What exactly happens to function argument availability when using a filter?
- Combining several CSS files into one for optimization
- Create a post builder skin in a plugin
- remove_action not removing add_action from constructor
- How do I add some javascript validation to the admin interface form’s onsubmit?
- Can my hooked uninstall class function access a global var declared in main plugin file?
- Flipping Book PHP Code? Any experience?
- Hook for page Request?
- Display Plugin Panels Outside of Admin Areas
- How to remove js ui library added by default by wordpress
- How to use the pre_option filter before a plugin loads?
- How to remove a class function from a plugin by using remove_action()?
- profile_update hook doesn’t works inside a class
- Plugin: Hooking up classes that have their own hooks
- Hook for altering the content of all wp mails
- What hook can I use to modify custom post data before it is displayed on the page?
- Quick press publish post hook
- How to deactivate my plugin upon deactivation of NextGen
- Creating a plugin that will display text on every page
- Why does “updated_post_meta” did not fire when uploading media other than image?
- Build a must-use plugin that tracks when other plugins are activated or deactivated
- Change Dashboard URL from wp-admin to wp-admin/index.php
- Activation flow of a plugin in a multisite environment
- Callback hooked to post_updated firing on new posts as well
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- Replace plugin HTML to single text using hooks
- How can I disable W3 Total Cache Image Lazy Load for Specific Post Type?
- Customize plugin templates
- wordpress plugin translation not working
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- Hook on widget context plugin to add custom context for widget
- Publish check if the edited content has HTML “div”
- Admin page and admin menu. Permissions plugin
- How should I use a plugin function as a hook?
- Display_rows() and column_cb() strange behaviour
- change output location of plugin function using a custom hook
- Plugin constructor called multiple times
- How to change value of $menu_class in ep_nav_menu?
- How to create and use Custom hooks
- How to display a link in the footer section
- How wordpress plugin hooks works? [duplicate]
- Post curl function save twice using plugin hook function wordpress
- How to Add Extra Text In WordPress Title Before Post Publish
- Why is my activator class adding the files/running the actions I add?
- Admin Notice is only localized when displaying the “Plugins” Backend Page