• Resolved Jon Scaife

    (@jonscaife)


    Hi
    I have recently enabled a content security policy which has flagged up inline css which I would prefer to remove where I can. I notice that if I use avatars then there is a bit of inline CSS included with each that specifies a padding-left and min-height. I would rather control this through my child theme stylesheet and turn off the inline CSS. Is there a way to do this, or could one be added? Either by applying a filter function, or (even better) an option in the shortcode

    The line that applies this is in Util.php line 104

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Thanks for getting in touch. We’ve just released a new version of the plugin (1.1.2) which includes a filter to enable/disable the inline CSS for avatars. You’ll have to add some PHP code to your child theme (or other plugin) to disable it. This is the code you would need to use:

    
    add_filter( 'better_recent_comments_enable_avatar_inline_css', '__return_false' );
    

    That will disable the CSS on the comment-wrap element and you can add your own styles via your theme’s stylesheet.

    Hope that helps…

    Thread Starter Jon Scaife

    (@jonscaife)

    Hi Andy
    Thank you for the superb and speedy update. The tweak you provided works spot on with the latest version. I’ve added my own css to my child theme stylesheet and so no longer have any inline CSS which is fantastic (both for SEO and for Content Security Policy). Thanks again!

    Great, glad it’s all sorted ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘inline css’ is closed to new replies.