How to stop javascript code being broken when going into visual editor
Is there any way to stop this Don’t have JavaScript in your editor. It’s dirty and difficult to maintain (as you’ve found out). Instead, you could: Use a page template Use custom fields (post meta) Use conditional code in your functions.php For 3), as an example: function wpse_202946_script() { if ( is_page( ‘id_or_title_or_slug’ ) ) … Read more