There is several ways to display code in WordPress.
1. This text using WordPress feature Code Block.
<?php
echo phpversion();
?>
2. Paste your code on Hilite.me and paste the result on WordPress Code View editor.
1 2 3 |
<?php echo phpversion(); ?> |
3. Using prism.js. Here the example for displaying php script.
Welcome to WordPress. This is your first post. Edit or delete it, then start writing!