Pasting images removes class attribute

Instead of pasting into the Visual editor, switch to the html editor for pasting any kind of html, or using shortcodes. I’d recommend checking the “disable the visual editor” checkbox in your user profile. Then install Mark Jaquith’s Markdown on Save plugin for more readable formatting without the wysiwyg pitfalls.

Apply custom style to single word in WordPress

Solved it… In my functions.php I should have put: array( ‘title’ => ‘Hidden Element’, ‘inline’ => ‘span’, ‘classes’ => ‘hiddenElement’, ‘wrapper’ => false, ), not array( ‘title’ => ‘Hidden Element’, ‘block’ => ‘span’, ‘classes’ => ‘hiddenElement’, ‘wrapper’ => false, ), as here: http://www.wpbeginner.com/wp-tutorials/how-to-add-custom-styles-to-wordpress-visual-editor/

Snippet: Use classes instead of inline styles for text alignment

Note This answer was originally included in @bitstarr‘s question above and was included as a separate answer here to comply with WPSE’s Q&A model. Maybe someone else will have this issue and so i will share my solution here with you folks. function make_mce_awesome( $init ) { /* There are easier things than make ‘left/center/right … Read more

Resizing the width of the WYSIWYG editor

The WYSIWYG uses the .wp-editor-container class. So the easiest way would be to change this in your CSS. If your style is being overwritten then just add !important. .wp-editor-container { width:50%; // What ever size you want } the wp_editor() function also allows us to add a class to the textarea tag, I’m not sure … Read more

How to remove commenters ability to add hyperlinks to comments?

WP runs so many prettifying filters on this stuff that it’s easy to get lost. Here is what I ended up with: remove_filter(‘comment_text’, ‘make_clickable’, 9); add_filter(‘pre_comment_content’, ‘strip_comment_links’); function strip_comment_links($content) { global $allowedtags; $tags = $allowedtags; unset($tags[‘a’]); $content = addslashes(wp_kses(stripslashes($content), $tags)); return $content; } This scrubs out clearly defined links and removes filter that turns plain … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)