Home  >  Article  >  CMS Tutorial  >  How to use markdown syntax in wordpress

How to use markdown syntax in wordpress

下次还敢
下次还敢Original
2024-04-15 18:45:161063browse

Markdown is a simple markup language for formatting text. Markdown can be used directly in WordPress 5.0 and above. Users can also install a Markdown plugin or enable Markdown support using the classic editor, or manually write Markdown syntax in HTML view. Markdown syntax includes: title (use # plus numbers), bold (use *), italics (use), unordered list (use -, * or), ordered list (use numbers and dots), link (use [text ] (link address)), code block (use three backticks), strikethrough (use ~~), quote

How to use markdown syntax in wordpress

Used in WordPress A guide to Markdown syntax

#What is Markdown?

Markdown is a lightweight markup language used to create formatted text that is easy to read and write and approximates plain text. Markdown syntax is mainly used for writing documents and blog posts.

Using Markdown in WordPress

WordPress provides multiple ways to use Markdown:

  • Default for WordPress 5.0 and above Supports Markdown: Just enter Markdown text in the editor.
  • Install the Markdown plugin: If you are using a version of WordPress prior to 5.0, you can install the Markdown plugin to enable support.
  • Use Classic Editor: Select Classic Editor to disable the new block editor and use Markdown.
  • Write directly in HTML view: Switch to HTML view and add Markdown syntax manually.

Markdown Syntax

The following is the Markdown syntax commonly used in WordPress:

Title

  • Use # and add numbers to represent different title levels. For example: ## Title 2

Bold and italic

  • Use ** tags Bold text. For example: **Bold text**
  • Use * to mark italic text. For example: *Italic text*

List

  • Use hyphens (-), asterisks ( *) or plus sign ( ) to create an unordered list. For example:

  • Item 1
  • Item 2
  • Item 3

  • Use numbers and dots (1 .) Create an ordered list. For example:

  • Step 1
  • Step 2
  • Step 3

Link

  • Use [text](link address) to create a link. For example: [WordPress](https://wordpress.org)

Code block

  • Use Three backticks (`) create a code block. For example:

    <code>echo 'Hello, world!';</code>

Other common syntax

  • Strikethrough: ~~Strikethrough text~~
  • Quote block:> Quote text
  • Table (requires plug-in support):| Column 1 | Column 2 | Column 3 |

Tip

  • Ensure correct Markdown syntax.
  • Preview the text in real time to see the formatting effect.
  • Use Markdown editor to simplify formatting.
  • WordPress provides official Markdown documentation for reference.

The above is the detailed content of How to use markdown syntax in wordpress. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn