Skip to content
Advertisements

How to Add Syntax Highlight to WordPress Blog?

The default blog template and themes on WordPress do not have syntax highlighting enabled by default. I post many code blocks in my post and needed syntax highlight.
I am new to CSS so tried many solutions and found Prism to be the easiest and working out of the box.

How to Add Syntax Highlights?

  1. Download CSS code of Prism
  2. If you are on a premium plan to WordPress, you can create your CSS code for the blog/website.
    css editor
  3. Paste the Prism CSS code here. That’s all!
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: