Skip to content

Commit

Permalink
adding code at footer
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Rauch committed Mar 21, 2013
1 parent cddd15f commit f94e306
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions wp-reading-time.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function __construct() {

// Register site styles and scripts
add_action( 'wp_enqueue_scripts', array( $this, 'register_plugin_scripts' ) );
add_action('wp_head', array( $this, 'my_custom_js'));
add_action('wp_footer', array( $this, 'my_custom_js'));

// Register hooks that are fired when the plugin is activated, deactivated, and uninstalled, respectively.
register_activation_hook( __FILE__, array( $this, 'activate' ) );
Expand All @@ -52,18 +52,17 @@ function __construct() {
* Registers and enqueues plugin-specific scripts.
*/
public function register_plugin_scripts() {
wp_enqueue_script( 'jquery-reading-time', "https://raw.github.com/themeskult/jquery-reading-time/master/jquery.readingTime.js", array('jquery'));

wp_enqueue_script( 'jquery-reading-time', "//raw.github.com/themeskult/jquery-reading-time/master/jquery.readingTime.js", array('jquery'));

} // end register_plugin_scripts


public function my_custom_js() {
echo "
<script>
<script type='text/javascript' charset='utf-8'>
(function($) {
alert('here');
$('.post').readingTime();
$('body.single .post').readingTime();
})( jQuery );
</script>
";
Expand Down

0 comments on commit f94e306

Please sign in to comment.