我可以在如下自定义模板中列出为将来设置的页面:
query_posts(\'post_type=page&post_status=future&posts_per_page=100&order=asc&orderby=date&meta_key=_wp_page_template&meta_value=show.php\');
然而,当我尝试单击其中一个页面时,我得到了404(作为未登录用户)。
如何更改主题page.php
显示未来页面的模板?
我们已经在function.php
并为这种特殊类型的帖子提供一个特殊的页面模板。。。
我尝试将以下内容添加到functions.php
具有add_filter
, 但这没有帮助:
function show_future_where($where) {
return $where . \' AND (wp_posts.post_status = \\\'publish\\\' OR wp_posts.post_status = \\\'future\\\')\';
}
顺便说一句,我看到一篇关于自动设置未来日期的帖子将被“published”状态覆盖,但无法实现。
如果我可以编辑页面模板,我还能做些什么吗?
如果有帮助的话,我正在使用3.3。
谢谢