How to DISPLAY PHP VB PHP ASP CSS HTML Code IN WordPress Posts and pages?
SyntaxHighlighter Evolved WordPress Plugin by Alex Mills (Viper007Bond)
SyntaxHighlighter Evolved is a plugin by Alex Mills popularly kown as (Viper007Bond) over the internet. This plugin is based on the original SyntaxHighlighter JavaScript package by Alex Gorbatchev.
As blogs and websites created with WordPress CMS script don’t allow you to write or use potentially dangerous code on your blog’s content. Yet there may be a necessity where you wish to show some programming source code on your webpage for demonstration purpose and it wont either show up or show distorted as the server may execute the code as a script, but there is however a better way to post source code for viewing purpose. There are WP Plugins which you can use and with the appropriate syntex wrapped around source code that preserves its formatting and even provides syntax highlighting for certain languages. The Various Syntex Highlighter WordPress plugins allow you to Highlight PHP VB PHP ASP CSS HTML Source Code IN WordPress Posts and pages making them readable and understandable as a Highlighted source code example.
WP-SYNTAX WORDPRESS PLUGIN
WP-Syntax provides clean syntax highlighting using GeSHi — supporting a wide range of popular languages. It supports highlighting with or without line numbers and maintains formatting while copying snippets of code from the browser.
It avoids conflicts with other 3rd party plugins by running an early pre-filter and a late post-filter that substitutes and pulls the code snippets out first and then pushes them back in with highlighting at the end. The result is source code formatted and highlighted the way you intended.
Usage, Supported Languages, Styling Guidelines, and Release Notes are available
https://wordpress.org/plugins/wp-syntax/
Example of PHP page redirect script using WP-SYNTAX Plugin
1 2 3 4 5 6 7 8 | <?php // Change the URL of the page below header("Location: http://www.google.com/"); exit; // Exit will prevent any PHP script execution after the redirect code. ?> </div> |
Supported Languages
1 2 3 4 5 6 7 | <div id="foo"> <?php function foo() { echo "Hello World!\\n"; } ?> </div> |
- Syntex Highlighter Evolved Plugin by Alex Gorbatchev
- WP-Syntex Plugin
- WordPress Tutorial on Posting Source Code