在 WordPress Datewise 中为特定类别创建存档

发布于 2024-08-14 11:48:57 字数 391 浏览 4 评论 0原文

在我的网站中,我想添加一个存档页面或自定义页面,我想在其中显示特定类别的帖子以及日期格式的帖子,

例如:我在类别:技术 一天的所有帖子都会显示在这个页面上,就像我在那一天只写了 3 篇帖子一样。

导航的下一页将是上一个日期页面..它将显示前一天的所有帖子,例如 6 篇帖子等等,

我在其中看到此功能的示例页面是: http://www.thedailybeast.com/cheat-sheet/

我想以标题、小摘录格式显示它们..

我认为这是可能的使用自定义页面格式..

希望我能得到快速回复..thnx

In my site i would like to add a archive page or a custom page where i want to show posts from a particular category and that with a date wise format

like for example: i am in category : Technology
All post of a day will be shown at this page like i have written 3 posts only on that day.

The next page from navigation would be the previous date page .. which will show all posts from the previous day like 6 posts and so on

Example Page where I have seen this Functionality is : http://www.thedailybeast.com/cheat-sheet/

i want to show them in Title, little excerpt format ..

i think its possible with a custom page format ..

Hopefully i can get a quick response .. thnx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等待圉鍢 2024-08-21 11:48:57

您可以使用 archive.php 文件或制作自定义模板文件,然后使用 query_posts。请参阅: http://codex.wordpress.org/Template_Tags/query_posts

我会看看示例2 在“将变量传递给query_posts”下类似这样的东西应该可以工作。

    <?php

$current_day = date('d');
$current_month = date('m');
$current_year = date('Y');

query_posts("cat=22&year=$current_year&monthnum=$current_month&day=$current_day&order=ASC");
?>
<!-- put your loop here -->

you can probably either use your archive.php file or make a custom template file then use query_posts. See: http://codex.wordpress.org/Template_Tags/query_posts

I would look at Example 2 under "Passing variables to query_posts" Something like this should work.

    <?php

$current_day = date('d');
$current_month = date('m');
$current_year = date('Y');

query_posts("cat=22&year=$current_year&monthnum=$current_month&day=$current_day&order=ASC");
?>
<!-- put your loop here -->
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文