Remove WYSIWYG editor on all custom post type EXCEPT regular posts

A bit involved, but this should work: function remove_wysiwyg() { global $pagenow; if ( ‘post.php’ == $pagenow ) { $type = get_post_type( $_GET[‘post’] ); if( ‘post’ != $type || ‘page’ != $type ) add_filter(‘user_can_richedit’, ‘__return_false’); } elseif ( ‘post-new.php’ == $pagenow ) { if( isset( $_GET[‘post_type’] ) && ‘page’ != $_GET[‘post_type’] ) add_filter(‘user_can_richedit’, ‘__return_false’); } … Read more

How to remove p tags around img and iframe tags in the acf wysiwyg field

Ok if you want to strip the p tags for img’s and iframe’s for advanced custom fields you have to exchange the_content with acf_the_content . The code looks that way: function filter_ptags_on_images($content) { $content = preg_replace(‘/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU’, ‘\1\2\3’, $content); return preg_replace(‘/<p>\s*(<iframe .*>*.<\/iframe>)\s*<\/p>/iU’, ‘\1’, $content); } add_filter(‘acf_the_content’, ‘filter_ptags_on_images’);

Prevent WordPress from messing my HTML

I assume you are using the text editor… The example with the blank line in your question would normally be converted by WP to this: <ol> <li>Paragraph 1 : text <p> Some more text</p></li> <li>…</li> </ol> Wpautop wraps the 2nd line with the p element because of the blank line you created. Your example of … Read more

Creating table layout in WYSIWYG editor

Why you are not using table? Spaces are ridiculus. On WYSIWYG editor select table with 2 columns and 3 rows, align items in left column to left, and in right to center and everything should work fine. EDIT. Ok, I see where is the problem. TinyMCE (WYSIWYG editor) has table option, but by default it … Read more

Stop WordPress Visual Editor converting backticks into code blocks

This has solved the problem, simply remove the plugin which automatically formats text as you type, from loading in the first place. add_filter( ‘tiny_mce_plugins’, ‘rwebster_editor_remove_wptextpattern’, 1, 99 ); function rwebster_editor_remove_wptextpattern( $plugins ) { $wptextpattern = array_search( ‘wptextpattern’, $plugins ); unset( $plugins[$wptextpattern] ); return $plugins; }

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