php - Automatic highlight code in a wordpress blog -


I have an automatically-installed WordPress blog that is full of Python snippets and I want to highlight them (source code Colour) . I tried to install some plugins, but they need to edit all my posts that add some ethers to the pre-tags.

Do I have to pre-tag the plugins or other plugins in WordPress?

You can create a simple plugin that will register "filter". This filter will apply to all your posts:

  function enhance_pre_tag_filter ($ content) {$ content = preg_replace ('/ / lt; pre & gt; /', '& lt; pre python_tags & Gt; ', $ content); Return $ content; } Foreach (array '(the_content', 'the_title', 'comment_text') as $ filter) add_filter ($ filter, 'enhance_pre_tag_filter', 9);  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -