【发布时间】:2011-10-12 13:42:20
【问题描述】:
现在我正在使用以下插件 - 'shortcoder' 允许我使用单个帖子推送我的 wordpress 网站的整个首页。
以下是我帖子的结构-
[shortcode 1]
[shortcode 2]
[shortcode 3]
[shortcode 4]
[shortcode 5]
[shortcode 6]
现在这些都是静态的,只包含 html 和 javascript 内容。这篇文章正在使用“the_content()”模板标签显示在我的 index.php 上。
但是现在我将从我的其他帖子中提取一些动态内容来代替其中一些逻辑将在 index.php 文件中硬编码的短代码。例如-
[shortcode 1] static
[shortcode 2] static
[shortcode 3] dynamic
[shortcode 4] static
[shortcode 5] dynamic
[shortcode 6] static
为了清楚起见,所有静态部分都将通过短代码来实现,而动态部分将在 index.php 文件中进行硬编码。
但是,由于串行顺序,这个逻辑变得混乱。
我想以某种方式将通过“the_content()”的内容分成适当的静态部分。
抱歉,这篇文章很长,但我希望有人能提出解决方案。
【问题讨论】:
标签: php wordpress wordpress-theming