Which editor are you using? Are you switching editors at any point?
Thread Starter
Rahul
(@rahulrulez)
Well I use default editor that comes with WordPress.. I only switch to Visual and HTML whenever I need.
Even if I don’t switch and Save Draft, code messes up 🙁
Thanks a lot for super quick reply 😀
Never, ever, switch editing tabs on any given Post or Page. That will create just the kind of issues that you describe.
Thread Starter
Rahul
(@rahulrulez)
Any solution for that Sir?
Sometimes, code just mess up when I save draft and the page automatically refreshes :/
Sorry – there isn’t a fix for this. It’s a by-product of the TinyMCE Visual Editor 🙁
Thread Starter
Rahul
(@rahulrulez)
Well,
I haven’t switched editor and written an article with code blocks in to it.
I saved a draft and clicked on preview. After couple of Saves.. Again it messed up.. This makes me sick and loosing my faith on WordPress 🙁
I am using SyntaxHighlighter Evolved plugin.
🙁 Help me.
I am not switching editor while editing and still this is happening..
For an instance,
class My_Widget extends WP_Widget {
public function __construct() {
// widget actual processes
}
public function form( $instance ) {
// outputs the options form on admin
}
public function update( $new_instance, $old_instance ) {
// processes widget options to be saved
}
public function widget( $args, $instance ) {
// outputs the content of the widget
}
}
register_widget( 'My_Widget' );
becomes
<br />class My_Widget extends WP_Widget {<br /><br /><%%KEEPWHITESPACE%%> public function __construct() {<br /><%%KEEPWHITESPACE%%> // widget actual processes<br /><%%KEEPWHITESPACE%%> }<br /><br /><%%KEEPWHITESPACE%%> public function form( $instance ) {<br /><%%KEEPWHITESPACE%%> // outputs the options form on admin<br /><%%KEEPWHITESPACE%%> }<br /><br /><%%KEEPWHITESPACE%%> public function update( $new_instance, $old_instance ) {<br /><%%KEEPWHITESPACE%%> // processes widget options to be saved<br /><%%KEEPWHITESPACE%%> }<br /><br /><%%KEEPWHITESPACE%%> public function widget( $args, $instance ) {<br /><%%KEEPWHITESPACE%%> // outputs the content of the widget<br /><%%KEEPWHITESPACE%%> }<br /><br />}<br />register_widget( 'My_Widget' );<br />
After saving a draft and previewing.. 🙁
What happens if you don’t use that plugin. I post code inside <pre> and <code> tags all of the time and I haven’t hit any problems.