- This topic has 9 replies, 5 voices, and was last updated 5 years, 8 months ago by David.
-
AuthorPosts
-
February 10, 2016 at 2:39 pm #171928Vernon Lees
Hi Tom,
I hope you are doing well.
I should just start by saying that I’m loving the way this theme keeps evolving and being enhanced!
Hopefully a quick question. I would like to change my post metadata to display the last modified ‘updated’ time on the post rather than the creation date (entry-date published).
I’d also like to add some headings to the metadata eg. add headings such as ‘Modified Date’, ‘Author’ etc.
I can see this is the code but would appreciate if you could point me to the files/ give me an idea of how to change this.
Many thanks!
February 10, 2016 at 10:21 pm #171970TomLead DeveloperLead DeveloperHi there,
To show the modified date, add this CSS:
.posted-on .updated { display: block; }
To hide the published date, add this CSS:
.posted-on .published { display: none; }
Adding CSS: https://generatepress.com/knowledgebase/adding-css/
To add labels, add this PHP: https://gist.github.com/generatepress/8aa8c2d0f9457af904cf
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
February 15, 2016 at 8:44 am #172887Vernon LeesSorry Tom,
Events overtook me and I’have only just got around to looking at this.
It works perfectly. Many thanks!
February 15, 2016 at 10:41 am #172917TomLead DeveloperLead DeveloperYou’re welcome π
October 9, 2016 at 8:10 am #233777MiroslavHi Tom! I don’t want to hide the text with CSS as it doesn’t remove it from the source code. Is there a better way to do this? Thanks!
October 9, 2016 at 9:56 am #233810TomLead DeveloperLead DeveloperAre you wanting to remove the entire date? If so, you can do that using the Blog add-on in “Customize > Blog > Blog Content”.
Let me know π
October 9, 2016 at 10:21 am #233824MiroslavHi, no. (Among other things) I want to replace the published date with the modified date. I also want to do other things (like keeping the author’s name but without a link, remove the excerpt altogether, etc.). I know what WordPress tags to remove/replace. But I need an advice on what is the best way to go about it. I’m assuming using a child theme with modified functions.php file and, possibly, also creating a custom loop template(?). Am I right, or is there a better way? Thanks!
October 9, 2016 at 11:14 am #233838TomLead DeveloperLead DeveloperAh, the function that handles the post meta is wrapped in a function_exists() function which means you can overwrite the entire function in your child theme.
Here’s the function: https://gist.github.com/generatepress/3825ebd0c780b6021b0126c515f141e6
So if you paste that into your child theme you can adjust it as needed π
July 14, 2018 at 10:41 pm #623908Ravi DixitHey, Tom!
How can I show “Updated:” before the date?July 15, 2018 at 3:15 am #624006DavidStaffCustomer SupportHi Ravi,
i see a new post has been raised. One of the team will look at it asap.
-
AuthorPosts
- You must be logged in to reply to this topic.