How do I add syntax highlighting to a WordPress blog hosted on WordPress.com?

前端 未结 9 693
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 07:57

I\'d like to have a good syntax highlighter for my WordPress blog. What options do I have available? I often see one which has well-colored syntax highlighting and options to c

9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-31 08:24

    On wordpress.com, you can't install plugins, so you have to use Wordpress' built-in widget.

    Do it like:

    [code language='python']
    
    [/code]
    

    Note that those tags go inside your visual editor, not the HTML editor.

    You can find more information here.

提交回复
热议问题