Home › Forums › Support › Add PHP code just before </head> This topic has 5 replies, 3 voices, and was last updated 5 months, 3 weeks ago by Fernando. Viewing 6 posts - 1 through 6 (of 6 total) Author Posts October 4, 2022 at 2:37 pm #2363320 Butch Pornebo Would like to insert the following php code just before </head> <?php the_field(‘some_script_before_head_closing’); ?> What hook should I use? October 4, 2022 at 2:41 pm #2363325 YingStaff Customer Support Hi there, Try wp_head hook. October 4, 2022 at 2:47 pm #2363329 Butch Pornebo I want to make sure that the php code will be inserted just before </head> and whatever else in front of it. right? October 4, 2022 at 5:43 pm #2363413 Fernando Customer Support Hi Butch, Yes, if you want it inside <head> </head>, using hook wp_head should work. October 4, 2022 at 6:07 pm #2363425 Butch Pornebo how do I make that the code I’m adding is the last one before the </head>? e.g. <head> ….. some other code ….. some other code ….. some other code … my code </head> October 4, 2022 at 7:32 pm #2363475 Fernando Customer Support Set the priority to a really high value like 999999. Author Posts Viewing 6 posts - 1 through 6 (of 6 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In