How to Display Code on a WordPress Site


How to Display Code on a WordPress Site
Publish

Whenever a blogger starts a development related blog and want to display code snippets on blog posts they need the perfect plugin or function to show their cards on WordPress blog so if you want display code blocks on your WordPress blog then you can do it with the perfect plugin which can display all all programming languages codes in a blog post, displaying codes in WordPress site is not easy by default for the WordPress security reasons. I choose the best plugin for syntax highlighting and you don't need to confuse about which plugin best for displaying the codes to blog post. I already pickup the best one. have look below


Best Plugin for Displaying Codes


How to Display Code on a WordPress Site
Publish

There many plugins that can show codes snippets on the blog post and the best one that we going to use in this tutorial is "SyntaxHighlighter Evolved" with help of this plugin you can easily post syntax-highlighted code to your site. So download it from your WordPress plugins tab and install and active it, Once you have installed the plugin you will see a new tab called "SyntaxHighlighter" under the WordPress settings tab, click on that tab there you can set the theme of your code blocks and scroll down at the bottom of the page there you will see the shortcuts examples

How to Display Code on a WordPress Site
Publish

Now you can add the code snippets in your post by using the shortcut check the example, suppose I want to use PHP codes in the post, then I will add the name of language in square Brackets, All you have to do is just add the name the language in the square brackets and the paste the codes in between opening and closing square brackets

[php] <?php echo 'knowledge is free'; ?php> [/php]

[css] body{backgound:#000;} ?php> [/css]

If you Liked this tutorial then please like and follow us Twitter, Facebook

  • Recommended : Top 5 Wordpress Plugins That Make Your Blog Load Faster
  • Recommended : How To Secure WordPress Beginner Guide
  • Comments

    1. Hello dear ,

      I Have read your post. I like your post very much for your amazing thinking. It's just amzing my friend. By the way i want to informe your about-Spam is a HUGE problem with WordPress blogs, which makes an anti-spam plugin one of the most essential WordPress plugins. I use Spam Free WordPress, which seems to be doing quite well. Over the course of a 6 month period, it has blocked over 8,000 spam comments, a number that seems to grow exponentially.

      Thanks
      Angelina Jukic
      If you want to Know more then visit - wordpress plugins

      ReplyDelete

    Post a comment