After installing WordPress for this blog, I realized that I was forced to use the stupid TinyMCE WYSIWYG editor. I smiled when i found out that I was able to set a HTML editor only flag in my account settings. But this did not turn the editor into a pure HTML editor, since every line i wrote was replaced by <p>{the_line}<p>, which is not practical when you want to paste programming code.
Here is how you disable this unacceptable behavior the easy way (WP kindly asks you to find a plugin that undo the paragraphs, but you know…).
- Find the file wp-includes/default-filters.php.
- In the section with display filters, uncomment the filters wpautop and shortcode_unautop, that applies to the functions the_content and the_excerpt:
- <?
- // Display filters
- //add_filter( 'the_content', 'wpautop' );
- //add_filter( 'the_content', 'shortcode_unautop' );
- //add_filter( 'the_excerpt', 'wpautop' );
- //add_filter( 'the_excerpt', 'shortcode_unautop');
- //add_filter( 'get_the_excerpt', 'wp_trim_excerpt' );
- ?>
- If you did not create your own WordPress theme, I use the default myself, be sure to check if other strange content filters are applied. These are probably located in the file wp-content/themes/{theme}/functions.php.
- Enjoy creating articles in WP.
Das ist aber wirklich übertrieben dargestellt, oder denkst du nicht?