September 20, 2022 at 2:36 pm #505806philphilersonParticipant
Hello StudioPress forums.
I am having an issue regarding comment styling (the font, size, and color of commented text is being altered by commenters).
This happens on many different themes, but my primary theme is Magazine Pro (but I imagine the code needed to fix would work with many themes, which is why I put this in general).
I have a default comment styling selected for comments that is used whenever someone directly types in the comment box and submits a comment. (By styling, I mean the color, font size, and style of text.) This styling works fine whenever someone types directly into the comment box.
However, if a commenter copy and pastes text from a separate source, it uses the comment styling of the selected source. This allows commenters to manipulate/alter their comment to appear bigger or brighter compared to others, so now everyone is starting to do it.
I have tested this, and, for example, where the selected external text is a header, or a larger font size, or a different color, or even from within my own article where the text is not normal paragraph text, it will default to that new selected text styling over my default styling. Then it will not follow my default comment styling.
My question is—Does anyone know of any code that would require/demand the default text styling and override any copy/paste of outside sources?
I found this link from 2019 which seems to indicate that it may be a theme issue (the theme allows it). If so, how can I change it for all comment styling in Genesis? - https://sites.stmarytx.edu/webelaine/2019/04/05/gutenberg-change-font-size-options/. Additionally, I'm not great at coding, so it'd be easier if it could be done on the CSS end.
I am unable to share the website URL as it is a private website, so you wouldn't be able to see the comments, anyway. But here is an image I created to demonstrate the issue: https://imgur.com/a/W7B2wHt. I do use WPDiscuz, but this problem persists whether any plugins are active or not.
Thanks for any help you can provide. Have a great week.September 21, 2022 at 3:44 am #505813Brad DaltonParticipant
If you can disable/remove HTML tags from rendering in the comment form before comments are published then you can prevent inline styling.
I would use str_replace with the correct comment form hook. This requires testing to work out which hook and method work best.
September 21, 2022 at 11:23 am #505815philphilersonParticipant
Do you have any example code you could recommend that I could attempt to adapt to my specific use case? I'm not exactly sure how I would disable those tags or what to replace them with.
- You must be logged in to reply to this topic.