That may be a bit problematic. I use the plugin SyntaxHighlighter Evolved, but as the plugin description says (my emphasis):
TIP: Don’t use the Visual editor if you don’t want your code mangled. TinyMCE will “clean up” your HTML.
Another option is to embed Gists (or similar) using a Shortcode to pass the URL and let PHP render the script
tag (as suggested by Marco Berrocal).
<script src="https://gist.github.com/user/GistID.js"></script>
And the Shortcode path could also be used with Custom Fields. Paste the script in the CF and pass its name to the Shortcode for rendering. The plugin Advanced Custom Fields comes to mind.
Related Posts:
- WordPress Visual Editor Stripping HTML Changes
- Can you not edit the HTML and PHP of your WordPress without paying?
- What is the meaning of %s, %1$s etc.? [closed]
- Include WP_Query in my own PHP file?
- Shortcode to insert
- Has anyone tried putting PHP ActiveRecord on WordPress?
- Copyright info change in Theme Child PHP
- Add footer.php to WordPress child theme
- I want to remove the links from the term list returned by get_the_term_list
- Can I run custom php on specific pages in wordpress?
- Successful or Error Message after running mysql code in functions.php
- Can I view my own wordpress php source code on my hosted web server?
- How do i get (unique) page name?
- How to display posts of specific category using a custom Query in WordPress?
- The custom logo, site title, and description doesn’t appear at the same time
- stats_get_csv (WordPress Stats) to only display top posts (not pages)
- Hide wordpress field if data is empty in post!
- How to get the POST TITLE using the POST ID?
- Latest post in a specific menu
- Cause of Blank Lines Being Added to WP FIles?
- How to save checkbox values for logged in users?
- Insert custom PHP head above in WP pages
- Log in / Log Out Custom Button
- How to do a code in php and have text before it? [closed]
- PHP nested If statement syntax
- Display Data in Table from External Database in WP using Shortcodes
- How to Configure Events List in WordPress to Disappear Event Once Date is Past
- Code snippet to show current php version inside “At a Glance” box in admin
- Fatal error: Uncaught Error: Call to undefined function get_header() [closed]
- Disable Content Editor for Specific Pages
- using wp enqueue style to create a CSS file specifically for a page template
- Accidentally deleted php code in WordPress website [closed]
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- random reason on refresh
- Insert PHP code in Text
- PHP code snippet to remove microdata
- Counting number of posts in multiple (sub)categories using shortcode
- Need help for some PHP code
- Woocommerce display orders with products from specific categories to specific admins
- Woocommerce template file outputting tags
- Copying and pasting to WordPress “code editor” code via the front end and clipboard
- How to preload header logo image in WordPress? like what’s the code and where do I put it?
- How to put 2 php codes in functions.php without site crashing
- Displaying SQL query result from user input via wpdb
- How do I prevent WordPress from eating my code?
- admin-ajax.php 400 bad request – whats wrong with my code?
- style.min.css code issue
- Not able to add new item in wordpress home page
- how to run a php code in widget?
- how to add number value in front for variable [closed]
- Blog only showing code
- Display pages from specific page template
- why is markup routinely placed in functions in wordpress?
- Themes with variable width or single columns? I want to display source code
- Open all external links in new window – need help with the code
- Add Condition if WPBakery Page Builder Used on Page or Not
- How to get the Woocoomerce subtotal value without tax in the hardcode? [closed]
- Where to put include php file?
- Dynamically added text at bottom of article – non searchable by PHP code
- how to create twitter card without plugin in wordpress website?
- How to declare a variable at the bottom of the page and use its value at the top?
- How do I modify the with wp_nav_menu()
- How to add custom checkout field in user details mail template
- The search engine of my website finds only posts and not pages, how can I solve this problem?
- MySQL update text field with ‘
- Pull GET parameter from URL in functions.php
- Shortcode working in page.php but not in category.php in wordpress
- Fatal error: Uncaught Error: Call to undefined function wp_nav_menu()
- How to NOT override inline css rules
- WP_Query based on another query on the page
- WordPress Memory limit not increasing
- What’s the best way to format ACF number fields for display on the front end?
- Create an unique ID number after submit form
- wp_head makes my custom page template not work in Customizer?
- static array on functions.php
- Adding Gravity Form With if(is_page) Is Not Working
- Cross origin ajax request always returns 0 when calling get_current_user_id();
- WooCommerce Custom Pagination
- ACF: Echo page title when checkbox is checked
- How to print array of specific item
- How can I re-use PHP code across different pages?
- js code not stored in database currectly
- Hide the content before the more tag in the “single page”
- Fetching wpdb data from a php file seems to break?
- Troubleshooting “loopback requests that take too long”
- Having an HTTP error 500 after migrating a website
- echo php values in table – strange behaviour, not all values are shown
- category & sub category order issues in wordpress
- Data inserted in database, but ajax calls error function
- AJAX & PHP | Call a specific PHP function from a PHP file via AJAX?
- Adding a Sub Menu Options Page WP Backend Menu. Whats wrong with my code?
- Changing posts date
- Redirect users not logged in to the standard login page (and back) from some posts and pages
- Why does a meta_query break this WP_Query?
- If I define a variable in header.php, how do I make it available to templates?
- Conditional in foreach loop is outputting content twice
- Issues separating my Plugin pages into different files
- Merging two excerpt functions to work with conditions
- How to implement conditional PHP in Footer
- Does wp_query and query_posts affect website performance? [duplicate]