使用快捷码来传达我的页面设计

时间:2012-05-03 作者:Gandalf

我看到了这一页http://flare.bringthepixel.com/pages/services/ 上面有这样一条消息:“这个示例页面的整个代码都可以在短代码生成器中找到”。

假设我给了某人这个主题,并希望生成他/她自己的页面,就像所显示的页面一样,而不需要插入一个接一个的短代码。短代码是否可以用来制作一个大页面的“模板”,这样插入一个短代码后,服务页面中的设计就会被插入,用户只能将虚拟内容交换为自己的内容?。

1 个回复
最合适的回答,由SO网友:Ashfame 整理而成

If you are going to use that shortcode inside post/page content, then you can build any layout/design with that shortcode. You can do even more if you are calling do_shortcode() in your theme.

Technically its possible to do it and whether it would be a good implementation or not depends on the use case. Like for specific layouts inside the page content, this is an excellent choice but for using it as a substitutes to page templates, that will be a bad design choice.

You can do pretty much inside a shortcode, point is when you should. Read more on implementation here - http://codex.wordpress.org/Shortcode_API

结束