github初学者指南_初学者指南:如何回溯WordPress帖子的日期

github初学者指南

Recently, one of our users asked if it was possible to back date their WordPress posts. The answer is YES. WordPress allows you to change dates on any posts that you write. You can publish a post with current date and time, back date it to a past date and time, or you can even schedule posts to be published in the future. In this article, we will show you how to back date your WordPress posts.

最近,我们的一位用户询问是否可以回溯其WordPress帖子的日期。 答案是肯定的。 WordPress允许您更改所写文章的日期。 您可以发布带有当前日期和时间的帖子,将其回溯到过去的日期和时间,甚至可以安排帖子在将来发布。 在本文中,我们将向您展示如何回溯WordPress帖子的日期。

Back Date your WordPress Blog Posts
影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

Start by editing the post that you want to back date in your WordPress admin area.

首先在WordPress管理区域中编辑要备份日期的帖子。

On the post editor screen, under the Publish meta box you will see the option to publish the post immediately. Right next to it, there is an edit link. Clicking on the edit link will display the post’s time and date settings.

在帖子编辑器屏幕上的“发布元”框下,您将看到立即发布帖子的选项。 在它旁边,有一个编辑链接。 单击编辑链接将显示帖子的时间和日期设置。

Edit a post's date and time in WordPress

Using the date and time settings, you can choose any date and time in the past as well as in the future. Choosing a future date and time will allow you to schedule the post to be published on that time.

使用日期和时间设置,您可以选择过去以及将来的任何日期和时间。 选择将来的日期和时间将使您可以安排在该时间发布的帖子

Scheduling a post in WordPress

On the other hand, choosing a date and time in the past will update the date and change the post’s position in your site’s archive pages. For example if you change the month of a post from June to January, then it will appear on the January’s monthly archive page even if you just published that post. The post will also appear accordingly on the all posts list page in the admin area.

另一方面,选择过去的日期和时间将更新日期并更改帖子在站点存档页面中的位置。 例如,如果您将帖子的月份从6月更改为1月,则即使您刚刚发布该帖子,该帖子也会显示在1月的每月存档页面上。 该帖子也会相应地显示在管理区域中的所有帖子列表页面上。

A newly added back dated post appearing at the bottom

This is particularly useful when you want to publish an article, but don’t want it to appear on the front page of your site. You can just back date it to a date earlier than the last post on your site’s front-page.

当您要发布文章但不希望其出现在网站的首页时,此功能特别有用。 您可以将其回溯到网站首页上的最后一篇文章之前的日期。

如何显示上次更新日期 (How to Show Last Updated Date)

Some users believe that they should remove dates altogether from their blogs to trick search engines into believing that their content is not time-sensitive and is always fresh.

一些用户认为,他们应该从博客中完全删除日期,以欺骗搜索引擎,使他们认为其内容不是时间敏感的,并且总是新鲜的。

We disagree with that opinion entirely. It does not help with your site’s SEO, and it’s terrible for user experience. See our article on why you should not remove dates from your WordPress blog posts for more information on this topic.

我们完全不同意该意见。 它对您网站的SEO没有帮助,并且对用户体验来说很糟糕。 有关此主题的更多信息,请参阅我们关于为什么不应该从WordPress博客文章中删除日期的文章

At WPBeginner, we show the last updated date of an article instead of the publish date. Last updated dates are particularly useful for sites where content is regularly updated. Here is how to show last updated date on your WordPress blog posts.

在WPBeginner,我们显示文章的最后更新日期,而不是发布日期。 上次更新日期对于定期更新内容的网站特别有用。 这是在WordPress博客文章上显示最后更新日期的方法。

Sowing last updated date in WordPress

Locate the code that shows the post’s date and time in your theme files (usually in loop.php or single.php). Next replace it with this code:

在主题文件中找到显示帖子日期和时间的代码(通常在loop.php或single.php中)。 接下来,将其替换为以下代码:


Last updated on <time datetime="<?php the_modified_time('Y-m-d'); ?>"><?php the_modified_time('F jS, Y'); ?></time>

We hope this article helped you learn how to back date WordPress posts. You may also want to see our guide on how to display relative dates in WordPress.

我们希望本文能帮助您学习如何回溯WordPress帖子的日期。 您可能还希望查看我们的指南,了解如何在WordPress中显示相对日期

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/beginners-guide/how-to-back-date-your-wordpress-posts/

github初学者指南

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值