Okay, here is a working example of what you (might) want to do.
Put the following in your functions.php
:
add_action('wp_head', 'my_jquery_code', 999999999);
function my_jquery_code() {
$jquery_code = <<<JQUERY
<script>
// jQuery code goes here...
</script>
JQUERY;
echo $jquery_code.PHP_EOL;
} // function my_jquery_code
Related Posts:
- WordPress Code Flow
- How can i get the name parameter defined in get_header?
- Is there a way to read or list wp_head() contents?
- Multi-page posts do not get indexed by Google due to canonical URLs
- Remove rel=’dns-prefetch’ href=’//maps.google.com’ from wp-head
- How to remove pingback from head?
- wp_head() outputs in body
- Change dns-prefetch to preconnect for external enqueued resources
- How to remove unnecessary elements in the HTML document head
- wp_head() not including styles and javascripts after a template redirect
- Removing Visual Composer head meta (works alone but not with IF)
- removing wordpress generated code from the head section?
- Change default s.w.org dns-prefetch resource hint value
- using wp_head in body tag for css style
- Use wp-load() and wp_head() to render a page’s header outside of WordPress
- Set title of page using custom page template
- How do I add a logo to my website?
- Set up description meta automatically
- How to find which plugin is outputting Open Graph tags to
- Why would wp_head() cause the menus to break?
- wp_head function outputs after
- Remove_action inside a function
- Does adding a callback like this to wp_head allows you to add additional content?
- How can i remove JUST Description tag from wp_head() function?
- Custom page with WP Header showing Page not found title
- Getting the contents of wp_head while in admin?
- Wp_head () affecting my images layout
- How to add meta tags inside single image page?
- How to store wordpress functions (wp_head(),wp_footer()) in a javascript variable?
- “Warning: count()” printing in Page templates
- How can I edit a meta description
- Hide page name in wordpress page title
- Is it possible to add post specific info in head of worpress post for OG use
- Unable to apply selective loading
- why php tag is not working if i store and show it in wp_head?
- Data validation for inline javascript
- Add OG meta tags to wp head
- Add tags to the section via functions.php
- Why is wp_head() creating a top margin at the top of my theme header?
- What does l10n.js do in WordPress 3.1? And how do I remove it?
- Any advantage of using wp_scripts and is_IE when enqueuing scripts
- How do I force wp_enqueue_scripts to load at the END of ?
- wp_head() gives me some weird CSS
- How can I modify what is being output in wp_head, whether by a theme or WordPress in general?
- Removing specific style from wp_head
- Change title in head on Archive page
- Add code into on a per page/post basis
- How to load different css file for different pages
- Track down where script is being enqueued from
- append stylesheet via shortcode
- Change dns-prefetch to preconnect with correct protocol
- Manipulating wp_head content
- Disable wordpress from including jQuery in the head section
- wp_head() not inserting the default stylesheet style.css
- Filter out some plugin action in wp head / wp_footer
- Add HTML to single post tag
- add_action and wp_head not display content in head section
- Trying to inject twitter metadata into using wp_head action in functions.php – get_the_excerpt() returns null
- Modifying meta tags after doing ajax call in plugin
- Remove meta description on certain pages
- Get latest posts from WordPress site without header, menu and sidebar
- CSS from textarea in options page to frontend what to do
- How do I test my localhost WordPress project with VirtualBoxVM?
- How can I add Javascript in the header of all post pages and only post pages
- How to modify default controls in WordPress theme customizer
- Inject HTML meta tag inside wordpress tag using add_shortcode
- How to replace a function using a child theme?
- How to get a single hook from wp_head()?
- Would there be anything stopping me from removing both wp_head and wp_footer?
- Can’t find where to modify attrbitutes
- Auto Generated HTML source code formatting
- Remove swfobject.js in wp_head()
- How to load a stylesheet into wp_head from a custom widget?
- Adding Plugin Assets to Header
- Prefix the title tag, if IP address is the dev server
- wp_enqueue_style on template_redirect level?
- How can I pass a shortcode value to the head in wordpress functions.php
- Wrong image path within inline styles in the head
- Include HTML (Bootstrap Modal Box) with a plugin into my header
- add_action to wp_head is added, but not called
- How to style injected code in header section?
- Function to echo (or display?) wordpress tags in the head section
- How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media?
- How do I modify the tag on my Category Archive page?
- Loading a plugin in a post template without using wp_head()
- Hide author info in single posts by certain users
- Add function to head “no product found”
- Inserting article:tags meta in html head-element, using get tags, no wp_head
- How do I override WordPress plugin css [closed]
- How to check widget-cpt meta and display its custom css in the head?
- Put dynamic Javascript in header after doing operations
- Best use adding user generated JS/CSS to a theme with a plugin
- How do I add Facebook OpenGraph meta tags for attachments in the header for a custom theme?
- wp_head hook content showing up at top of RSS feed
- Background of default template showing instead of the background of custom page template
- I add some js files from a plugin to a specific location
- How to output wp_enqueue_style() in HTML head instead of footer
- new to javascript – using in instead of functions.php, not loading correctly
- Head Code for Custom Taxonomy
- How to modify default tags in wp_head()