城市简码_如何在WordPress主题中使用简码

城市简码

Recently, we got a request from a user asking how they could use WordPress shortcodes in their WordPress themes. Shortcode is a special tag that you can enter into a post that gets replaced with different content when actually viewing the post on the website. If you have ever embedded a WordPress gallery on your blog, then you’ve already seen the built in shortcode. Check out our article on adding shortcodes in your themes.

最近,我们收到用户的询问,询问他们如何在WordPress主题中使用WordPress短代码。 简码是一个特殊标签,您可以输入一篇帖子,当在网站上实际查看该帖子时,该帖子将替换为其他内容。 如果您曾经在博客上嵌入WordPress画廊,那么您已经看到了内置的简码。 查阅我们有关在主题中添加简码的文章。

Thankfully, WordPress has a very easy function called do_shortcode() that lets you add shortcodes in your themes. Simply add the code like this:

值得庆幸的是,WordPress具有一个非常简单的函数do_shortcode() ,可让您在主题中添加短代码。 只需添加如下代码:

<?php echo do_shortcode("[example_shortcode]"); ?>

Simple and easy

:)

简单容易

翻译自: https://www.wpbeginner.com/wp-themes/how-to-use-shortcodes-in-your-wordpress-themes/

城市简码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值