Moderator
James Huff
(@macmanx)
Volunteer Moderator
Can you post the file that you’re using the code in on the pastebin, or are you using it as a plugin?
Thread Starter
zeaks
(@zeaks)
Here it is in pastebin.
http://wordpress.pastebin.com/JXhMyeeu
I’ve also tried just using this in functions.php and had the same issue as with the plugin.
http://wordpress.pastebin.com/dqee8Um5
Moderator
James Huff
(@macmanx)
Volunteer Moderator
Try instead (an older version of Otto’s code):
<?php
/*
Plugin Name: Gravatar Hovercards
*/
function gravatar_hovercards_jquery() {
wp_enqueue_script('jquery');
}
add_action('wp_enqueue_scripts', 'gravatar_hovercards_jquery');
function gravatar_hovercards() {
echo '<script type="text/javascript" src="http://s.gravatar.com/js/gprofiles.js"></script>';
}
add_action('wp_footer','gravatar_hovercards');
?>
Thread Starter
zeaks
(@zeaks)
Still causes the same error >.<
Moderator
James Huff
(@macmanx)
Volunteer Moderator
Can you paste the source output of your page when it’s finished load to the pastebin? I’m curious about what line 331 char 3 is.
Thread Starter
zeaks
(@zeaks)
Sure, but what file do you want me to paste from? I’m using the plugin.
Moderator
James Huff
(@macmanx)
Volunteer Moderator
Activate one of the themes that’s giving you trouble and load http://test.zeaks.org/
Then, view the source. In Chrome, that’s View/Developer/View Source, and in Firefox it’s View/Page Source.
Now, copy that into the pastebin.
Also, let us know which line and character the error references this time.
Thread Starter
zeaks
(@zeaks)
Moderator
James Huff
(@macmanx)
Volunteer Moderator
Line 331 is font-size: 1.2em;
which would mean that char 3 is n
, which really doesn’t seem like a problem to me.
And everything is fine when you remove the hovercard code?
Thread Starter
zeaks
(@zeaks)
yes everything is fine once I turn it off, no IE errors.
Thread Starter
zeaks
(@zeaks)
yes, I’ve tried ie 9 before and it does the same thing for me
Moderator
James Huff
(@macmanx)
Volunteer Moderator
Ok, try just this:
<?php
/*
Plugin Name: Gravatar Hovercards
*/
function gravatar_hovercards() {
echo '<script type="text/javascript" src="http://s.gravatar.com/js/gprofiles.js"></script>';
}
add_action('wp_footer','gravatar_hovercards');
?>
Thread Starter
zeaks
(@zeaks)
Still get an error in IE line 862 char 1, but it doesn’t work at all in FF with that code.
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0)
Timestamp: Thu, 14 Oct 2010 06:25:51 UTC
Message: Object expected
Line: 862
Char: 1
Code: 0
URI: http://s.gravatar.com/js/gprofiles.js
Moderator
James Huff
(@macmanx)
Volunteer Moderator
That’s probably because your theme doesn’t enqueue jquery, so you’ll need the first half of that code. One more thing to try:
<?php
/*
Plugin Name: Gravatar Hovercards
*/
function gravatar_hovercards_jquery() {
wp_enqueue_script('jquery');
}
add_action('wp_enqueue_scripts', 'gravatar_hovercards_jquery');
function gravatar_hovercards() {
echo '<script type="text/javascript" src="http://s.gravatar.com/js/gprofiles.js?g"></script>';
}
add_action('wp_footer','gravatar_hovercards');
?>
(note the slightly different script URL)