Jump to content

Hook Into The <Body> Tag

Recommended Posts


I need to hook into the <body> tag, in documentation I dont see a hook for this.


I simply need to make it <body onload="enableEmptyFields(document.choose);">


I'm not using a child theme BTW, I'm using the pagelines-customize for all other hooks which are working just fine.


Any thoughts?

Share this post

Link to post
Share on other sites

What is enableEmptyFields() ?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • Grant Turck
      By Grant Turck+
      What file do I need to add code to in my pl-framework-pagelines child theme to insert script after opening body tag on every page?
      Can you someone provide me with the code also?
    • Le Chef Est Une Femme
      By Le Chef Est Une Femme+
      Hey everyone
      I am very sorry if this question has a "deja vu"  taste but I have been looking for more than 2 hours a way to add a phone number in the top right corner of my header website.
      Before asking that, I have read many of the questions related to that subject, from hooks and action map to function.php and hooker plugin but I am very lost. Plus many links kindly given by some of you are now 404 pages
      Is there anyone willing to help me find the easiest way to add this number please ? 
      In advance, thank you 
    • JasonLA
      By JasonLA+
      Hey guys, 
      I have read a few other posts about this for Facebook but do not understand hooks.
      Could someone please explain how to use a hook in easier terms please? I am not very code savvy. I need to know exactly what to enter in and where it belongs. In the hook documentation this is not very clear at all.
      This is the page I need the code placed on; it's what users are taken to after they submit a form on the page before it: 
      Here is what I have put together from the Docs so far. I put this in my custom CSS and it did not work. 
      Any help is much appreciated!
    • ketri
      By ketri

      I'm using Types -plugin to add a field where the site owner can upload a PDF to each post. 
      On a category page I want to show the titles of the posts as links to these PDFs. The articles are only for pdfs, there is no content, exceprt, thumbnails etc. ever.

      So I should probably use a hook to insert a link to the PDF on the archive pages. I've tried using
      add_action('the_post', 'postFunction', 10);     function postFunction() {        echo "<h1>pdf link here</h1>"; } Just to get me started before I figure out the details of what to add. It now adds the code before the title on archive pages. But it also adds that code pretty much everywhere. https://www.dropbox.com/s/0p70s2h3sx0pjj0/Screenshot%202014-08-20%2010.07.31.png
      So how can I use a hook to add something to category pages?
      I'd also like to remove the title/link to the actual post, and the read more button.

      Thank you!