I used some markdown syntax and found it very good. In the past, blogs used the html language, and they still felt OK. After all, there were few html tags. Commonly used tags were code, a, li, and talbe. However, when reading the source code of the article, the several html tags still seem uncomfortable. Once opened and closed, they felt redundant. In addition, the document format does not seem clear.
But markdown won't be like that. Looking at the source code, you will feel that the entire article structure is still clear. Modify the wordpress structure and change it to the markdown syntax. Of course, you must support markdown extra.
Select and download plug-ins
The plug-in here uses the Michelin markdown classic version, which supports WordPress. Do not download it to PHP Markdown Lib, which does not support WordPress.
I found some markdown plug-ins on the internet and found a wide variety of plug-ins. I don't know how to determine them, so I just used the version of Michelin, because this is the first version I came into contact, there are preemptible ideas.
Install
This plug-in is easier to install.
Download the markdown. php file to the (site home)/wp-content/plugins/directory.
Go to the WordPress background and enable the plug-in.
Disable the visual editor. Go to the WordPress management background, select user> {select a User}> Visual editor, and choose not to use the visual editor when writing an article.
Then try to write your article using markdown ~
Compatible with syntax highlighting plug-ins
This plug-in is compatible with previous articles, but it is found that it is not compatible with SyntaxHighlighter Evolved syntax highlighting plug-in, and some redundant labels appear in the code section.
The following is the markdown. php source code:
Add_filter ('The _ content', 'mdwp _ markdownpost', 6 );
Add_filter ('The _ content_rss ', 'mdwp _ markdownpost', 6 );
Add_filter ('Get _ the_excerpt ', 'mdwp _ markdownpost', 6 );
The SyntaxHighlighter of markdown has different priorities. SyntaxHighlighter is 7, so I adjusted the markdown syntax to 10.
Add_filter ('The _ content', 'mdwp _ markdownpost', 10 );
Add_filter ('The _ content_rss ', 'mdwp _ markdownpost', 10 );
Add_filter ('Get _ the_excerpt ', 'mdwp _ markdownpost', 10 );
Write code in the article
To insert code in an article, you must use the SyntaxHighlighter syntax instead of the markdown syntax. After all, SyntaxHighlighter has its own syntax rules.
So the above syntax highlighting is still used as follows:
[C0de language = "php"]
Add_filter ('The _ content', 'mdwp _ markdownpost', 10 );
Add_filter ('The _ content_rss ', 'mdwp _ markdownpost', 10 );
Add_filter ('Get _ the_excerpt ', 'mdwp _ markdownpost', 10 );
[/C0de]
Forgive me for using c0de instead of code, because plug-in nesting is not good.