I'd like to add some custom HTML and jQuery to a page built with the page.php template. I know how to do the HTML and jQuery I want in functions.php but I'm not sure how to get a hook into page.php where I want it so I can get into functions.php. Currently the page I want to modify has been built with Visual Composer, but I don't see a way with Visual Composer to insert a hook.

Thanks for any suggestions.

2 Answers 2


if you want modify the content, there is the filter the_content.

if you want to intercept the template file before it is included : filter template_include

to catch a shortcode (like Visual Composer e.g.) : filter do_shortcode_tag and the filter vc_shortcode_output for only the shortcodes of Visual Composer


I got this working by using the Raw HTML and Raw JS elements of Visual Composer. (I was wrong about Visual Composer not having any elements to do this.) The only problem I had is that I messed up the Javascript the first time so that it didn't parse (I left off a ");" ). Then Visual Composer looped forever when I tried to get back in to edit the page. So the error kept Visual Composer from coming up, and without Visual Composer I couldn't fix the error! I had to make a fresh staging copy from the live site and start over.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.