WordPress.org

Ready to get started?Download WordPress

Forums

Hooking a bit of code to wp_head (3 posts)

  1. duncmorley
    Member
    Posted 3 years ago #

    I am looking to hook the code below into the wp_head. I have read the wordpress documentation and understand how to link in single .js files. Just wondered if there was a function i could write in the functions.php to hook the code below in without create a file for it.

    <script type="text/javascript">
    	Cufon.replace('h1'); // Works without a selector engine
    	Cufon.replace('#sub1'); // Requires a selector engine for IE 6-7, see above
    </script>

    Any help appreciated.

    Duncs

  2. esmi
    Forum Moderator
    Posted 3 years ago #

  3. duncmorley
    Member
    Posted 3 years ago #

    I know how to do this bit. I just didn't know if it was better practice to write a function in the functions.php and attach that to the hook.

    Are you suggesting dumping this script into its own file and pulling it in using the wp_enqueue_script?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.