模板中的WordPress快捷码

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了模板中的WordPress快捷码相关的知识,希望对你有一定的参考价值。

From CSS-Tricks: Shortcodes in WordPress are bits of text you can use in the content area to invoke some kind of function to accomplish certain tasks. For example, video embedding in WP 2.9+ uses the [video] [/video] shortcode. You can write your own shortcodes, and plugins often offer their functionality via shortcodes as well.

But what if you want to use a shortcode from within a template instead of with the content of a Post/Page? You can invoke it with a special function:
  1. <?php echo do_shortcode("[shortcode]"); ?>

以上是关于模板中的WordPress快捷码的主要内容,如果未能解决你的问题,请参考以下文章

Wordpress RSS快捷码

WordPress快捷码

Wordpress相关帖子快捷码

VSCode 如何操作用户自定义代码片段(快捷键)

Wordpress自动关闭快捷码

wordpress的简单iframe快捷码