a
anipage.io
免费开始
Glossary

Shortcode — WordPress简码是什么?

WordPress简码是像[gallery]这样的短占位符标签,在渲染时被复杂代码替换。

Definition

A WordPress shortcode is a short tag in square brackets — e.g. [gallery], [contact-form-7], or [et_pb_section] — used in content or templates. WordPress replaces this tag during rendering with the associated PHP code, which can be arbitrarily complex.

What are shortcodes used for?

Shortcodes serve as a simplified interface for complex functionality. Typical use cases: embedding galleries ([gallery]), contact forms ([contact-form-7 id='...']), slider elements, pricing tables, or the structured blocks of page builders like Divi ([et_pb_section]).

Shortcodes in Divi 4

Divi 4 stores page content as nested shortcodes: [et_pb_section] contains [et_pb_row], which contains [et_pb_column], which in turn contains [et_pb_text] and other modules. anipage.io generates this format natively for Divi 4 export.

Shortcodes vs. Gutenberg blocks

Gutenberg blocks have replaced shortcodes as the standard content storage format. Instead of [gallery], <!-- wp:gallery --> is now used. However, shortcodes remain fully compatible and supported by WordPress — especially in older themes and plugins like Divi 4.

Frequently Asked Questions

Can I use shortcodes in Gutenberg?
Yes. Gutenberg has its own 'Shortcode' block that renders existing shortcodes. For new content, however, native Gutenberg blocks are recommended.
What's the difference between shortcodes and blocks?
Shortcodes are text placeholders that trigger PHP functions. Gutenberg blocks are structured HTML comments with their own rendering system — more modern and flexible.
Does anipage.io use shortcodes?
For Divi 4 exports, yes — anipage.io generates native Divi 4 shortcode markup. For Gutenberg and Divi 5, no shortcode format is used.

准备好几分钟内创建 WordPress 页面了吗?

免费开始,每月3次生成。无需信用卡。无需承诺。随时取消。

立即免费开始

Related Terms

Related Articles