Hi guys,
I am trying to get to change the image class of my child-theme. I am using Twenty-Eleven as the main theme.
I searched around and found this:
http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/media.php
On line 225 is where the filter is: $class = apply_filters('get_image_tag_class', $class, $id, $align, $size);
Beauty! So I went ahead and did this in my functions.php:
function change_image_tag_class($class_name)
{
$class_name = 'colorbox';
return $class_name;
}
add_filter('get_image_tag_class','change_image_tag_class');
But when i refresh my screen, the image class hasn't changed... what am I doing wrong?
Btw, I started using wordpress only about a week and a half ago. Maybe my understanding of filters is murky? Actions I can understand. You "do_action()" first and have it in some section of the code. Then you go ahead and create a "add_action()" so it does that action at the point where do_action() is...
Or even that is wrong?
Please help! It's driving me nuts! I'm trying to use colorbox and I dont wanna use plugins, I wanna do this on my own...
Many thanks!!!
[i apologize if this has been asked already...]