Archived topic
How to add the time to the post?
17 replies · Started by Elio Martinez on June 19, 2015
Hi,
How can I add the date AND time to every single post? Now we see only the date.
Thanks.
Hi there,
Give this function a try: https://gist.github.com/generatepress/478c1ce1addf0f4f9726
Hi,
Thanks Tom, but with that function I see the modified date too, and I dont want that. I tried to delete some code to avoid that but I cant make the thing works if I delete something.
You're seeing the modified date? That part of the code didn't change at all - the modified date should be only visible to search engines.
Do you have a link so I can take a look?
Ok, its solved. I saw the modified date only in preview mode. Thanks.
You're welcome :)
Tom,
Withe new version of addons that you sent me yesterday I cant see the hour of the post. I uploaded that function to functions.php in my child theme days ago.
Ah, didn't anticipate this.
In newest version of GP Premium, the generate_posted_on() function is used to remove the byline elements completely instead of hiding them if that option is set.
To override it further with your own function, you'll have to add it into a custom plugin.
You can use this plugin to create a plugin: https://wordpress.org/plugins/pluginception/
Hmm, this is probably going to annoy a lot of people when they update.. Wonder if I can find a better way.
Hoping that you can find a better solution. I have no idea how to create a plugin to have the hour of the post and I prefer to not use a lot of plugins :(
Not sure it's possible - users want the disable author, date etc.. to fully remove them, not just hide them, so I have to do it this way.
The plugin I linked to above is incredibly simple - it gives you a file just like functions.php where you can add your custom PHP.
You can have 100 plugins like this and won't affect your site at all, it's the exact same as adding functions to your theme's functions.php file.
I have downloaded that plugin, create a new plugin, paste the function in the editor page of the plugin and activate it. Thats it?
That's it - it should now overwrite the function in Generate Blog.
I have did that but I cant see the hour. I have delete all cache too. I am missing something?
Try deactivating GP Premium and then activating it again.
I have an idea for a better method I'll play with tomorrow.
That deactivate-activate GP Premium doesnt make it work.
