0:00
Hi everyone, welcome to K2 blogging and in this video I will show you how you can display
0:04
last updated date in your generate press theme. So as you can see that here I am using the generate press theme
0:11
So let me just open it and you can see that you are familiar with this theme and here
0:17
there is this publish date. So if I want to change this date to a last updated date, then how can do that
0:24
So let me tell you what is the benefit of displaying a last updated date instead of
0:29
publish date. That's because if you use last updated date, it will improve the user experience and user
0:37
think that this post is updated recently and it must be useful
0:42
And also it will show the last updated date in Google as well
0:45
So you need to use the last updated date instead of the publish date
0:50
So to show that let me just go to the dashboard here and here we are going to use a PHP code
0:56
snippet for that. As you know, there is no functionality to change the publish date to last updated date
1:01
in the theme itself. So you need to use a custom PHP file
1:05
So for this, let me just go to plugins and I will click on add new
1:09
And here you can use any code manager plugin for that. So simply search for code manager and here you will get a lot of code manager plugins
1:17
So I prefer to use this one WP code and you can also use any of the code manager plugin
1:23
if you want like code snippets. So let me just activate this plugin
1:28
Okay, once you activated this WP code plugin, let's click on the code snippets here and
1:35
let's click on add new and let's add our own custom code
1:40
And here in the title, let's something like display last updated date in post and let's
1:54
change it to PHP snippets and you need to use your PHP code snippets
1:59
So let me just copy the code from here and I will click on copy and I will paste it here
2:07
like this. Now you can select where you want to run this code
2:13
So here you can run to page specific and you can set it like insert before post
2:21
So let's click on here and let's click on active and let's click on save changes
2:27
Although if you don't choose the location, then it will load worldwide
2:33
So I don't need to load this code everywhere. I just need to load this code in the post page only
2:39
That's why I have selected the location to insert before post. Now let's go to the post here and let me just open it here
2:49
And as you can see that it is still saying that it is published on August 5
2:53
That's because we have not updated this post at least once. So let's go to the edit post here and let me just make some changes here like this and
3:03
let me just update this post. Now if I open this post in a new tab, it will show that it is updated on August 26
3:12
So this is how you can show a last updated date in your generate fresh theme
3:17
So you just need to add a simple code snippet to your website and this will effect in your
3:25
generate fresh theme. So if you have any doubt regarding this, then you can ask me in the comment section and
3:30
if you want to learn more about generate fresh tutorial, do let me know in the comment section
3:36
I will see you in the next one. Bye Bye