- This topic has 17 replies, 2 voices, and was last updated 5 years, 10 months ago by Tom.
June 19, 2015 at 7:42 am #115561Elio Martinez
How can I add the date AND time to every single post? Now we see only the date.
Thanks.June 19, 2015 at 9:04 am #115571TomLead DeveloperLead Developer
Give this function a try: https://gist.github.com/generatepress/478c1ce1addf0f4f9726June 19, 2015 at 1:23 pm #115621Elio Martinez
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.June 19, 2015 at 1:37 pm #115626TomLead DeveloperLead Developer
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?June 19, 2015 at 3:41 pm #115645Elio Martinez
Ok, its solved. I saw the modified date only in preview mode. Thanks.June 19, 2015 at 4:43 pm #115648TomLead DeveloperLead DeveloperJune 24, 2015 at 9:27 am #116384Elio Martinez
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.June 24, 2015 at 10:36 am #116395TomLead DeveloperLead Developer
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.June 24, 2015 at 2:30 pm #116419Elio Martinez
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 🙁June 24, 2015 at 2:33 pm #116420TomLead DeveloperLead Developer
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.June 24, 2015 at 2:42 pm #116422Elio Martinez
I have downloaded that plugin, create a new plugin, paste the function in the editor page of the plugin and activate it. Thats it?June 24, 2015 at 2:42 pm #116423TomLead DeveloperLead DeveloperJune 24, 2015 at 2:47 pm #116425Elio Martinez
I have did that but I cant see the hour. I have delete all cache too. I am missing something?June 25, 2015 at 12:12 am #116468TomLead DeveloperLead DeveloperJune 25, 2015 at 12:19 am #116474Elio Martinez
That deactivate-activate GP Premium doesnt make it work.
- You must be logged in to reply to this topic.