jquery plugin only in one page/post
-
Hi there,
Ive seen all the documentation in the codex but I am doing something wrong since it doesnt work!
I want to implement this jquery plugin (https://github.com/davidcrawford/typist-jquery) in my welcome page (www.english.intermediavs.com)
Ive added this code in my function.php
function my_typist() { if (!is_admin()) { wp_enqueue_script('jquery'); wp_enqueue_script('jquery.typist', get_bloginfo('template_url') . '/wp-includes/js/jquery.typist.js', array('jquery'), '1.0', true); } } add_action('init', 'my_typist');
And I also introduced this code in “welcome page” by using html raw plugin.
<!--raw--> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/wp-includes/js/jquery.typist.js"> jQuery(document).ready(function($) { $('#terminal').typist({ height: 300 }); $('#terminal').typist('prompt') .wait(1500) .typist('type', 'greet') .typist('echo', 'Hello, world!') }); </script> <!--/raw-->
PS: I am using the plugin Use Google libraries as well.
Thanks in adavance!
http://codex.wordpress.org/Using_Javascript
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘jquery plugin only in one page/post’ is closed to new replies.