Whenever you try to enter code directly in the WordPress post or a page, its HTML or CSS corrupts the actual display. To display the code properly in the WordPress post or page, follow this;
Login to your WordPress admin control panel;
Go to Dashboard –> Plugins and click “Add New”
Next, type “SyntaxHighlighter” in the search button and you’d see a plugin called “SyntaxHighlighter Evolved” by Alex Mills. Simply press button “Install Now” to install and press “Activate” afterwards;
Next, click on “New Post” or “New Page” link to start entering text and code like below. In the classic editor, click “Text” tab and enter code like this;
Your code should be displayed like this after saving/publishing the post;
This is HTML code that makes the character <b>bold</b>.
The numbers on the left side denote the line numbers. You can deactivate those line numbers in the SyntaxHighlighter plugin settings.