Hello. I am trying to change the background color of the text input fields on my wpForo forum. I was able to change most of the text input fields with some added css, but the TinyMCE editors have proven more difficult.
I added the code below to the footer of my site and it changes the color of the editor background when you click into a specific forum and then click the 'Add Topic' button. If you click on the 'Add Topic' button on a forum index page and then choose the destination forum you want, the textarea of the editor that appears is the new color for an instant and then it changes back to white. The color change also does not work in the editor when you are editing a post.
<script type="text/javascript">
jQuery(window).load(function() {
tinyMCE.activeEditor.dom.addStyle('body{background-color:#ccffcc !important; color:#000000 !important; }');
});
</script>
Any ideas on how to change the background color of all the TinyMCE editors? I appreciate the help.
Any ideas?
Hi @donnongt
Please remove the code you've added in footer, then install and activate the Code Snippets plugin. After this, insert the code below using the plugin. The plugin can be found here: https://wordpress.org/plugins/code-snippets/ Another way, you can put the same code in the active theme functions.php file.
add_filter('wpforo_editor_settings', function($s){
$s['tinymce']['content_style'] .= "body{background-color:#ccffcc; color:#000000;}";
return $s;
});
The Code Snippets plugin make all sites SLOW. Not sure why, maybe because all code in stored in the database.
The best way is to create a pseudo plugin that contain all custom code. There is plenty of information about it on the net.