• When adding this simple snippet to functions.php it seem sot break something as the site will not load (or the wp-admin)

    function add_image_class($class){
    	$class .= 'new-class';
    	return $class;
    }
    add_filter('get_image_tag_class','add_image_class');

    The code looks correct to me and should be adding a class to uploaded images.

    Any thoughts?

Viewing 1 replies (of 1 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Just for giggles, what happens when you just make it less the .=

    function add_image_class($class){
    	$class = 'new-class';
    	return $class;
    }
    add_filter('get_image_tag_class','add_image_class');

    Do you still get the white page of death?

Viewing 1 replies (of 1 total)
  • The topic ‘add_filter in functions.php’ is closed to new replies.