Home › Forums › Support › Add ‘publish date’ to specific pages This topic has 14 replies, 5 voices, and was last updated 2 years, 7 months ago by Fernando. Viewing 15 posts - 1 through 15 (of 15 total) Author Posts February 13, 2022 at 6:01 am #2116568 Kia Hi GP Team, I would like to display the publish dates on specific pages. is there a way I can add the date the page was published (like in a blog post) to just a handful of pages? Many thanks. February 13, 2022 at 8:39 am #2116840 DavidStaff Customer Support Hi there, where within the page do you want to show the date ? February 13, 2022 at 11:04 am #2116950 Kia Hi David, Just below the title. Like in a blog post (example) Thanks. February 13, 2022 at 2:50 pm #2117116 DavidStaff Customer Support Try this: 1. Create a new Hook Element in Appearance > Elements: https://docs.generatepress.com/article/hooks-element-overview/ 2. Add this code to the Element text area: <?php echo get_the_date(); ?> 3. Set the hook to: generate_after_entry_header 4. Check the Execute PHP option 5. Set the Display Rule Locations to pages you want it to appear on: February 13, 2022 at 3:30 pm #2117137 Kia Works a treat! Thank you so much! 👊 February 14, 2022 at 3:51 am #2117652 DavidStaff Customer Support Glad to hear that! February 16, 2023 at 12:38 am #2535095 Ravi Saive @David, how to add the text ‘Last Updated‘ to date and align it to the right side? February 16, 2023 at 12:40 am #2535098 Fernando Customer Support Hi Ravi, For reference, can you provide the a to where you want to add this text? February 16, 2023 at 12:55 am #2535119 Ravi Saive I want to show the text ‘Last Updated’ with the date on specific pages on the right side… Here is the screenshot – https://i.postimg.cc/vT7sYxDD/Screenshot-2023-02-16-13-24-48.pngv February 16, 2023 at 1:09 am #2535129 Fernando Customer Support Can you share the link to that page? If you want, you can also start a new topic so you can use the Private Information field. February 16, 2023 at 1:13 am #2535139 Ravi Saive @Fernando, Here is the page link February 16, 2023 at 1:22 am #2535153 Derek Keen to do the same. I would like a “date published” and a “date modified” at the tops of each post. February 16, 2023 at 1:27 am #2535155 Fernando Customer Support Hi Derek, Are you referring to Posts or Pages? This topic is for showing the publish date on pages. If it’s for posts, kindly open a new topic. Ravi, Change this code: <?php echo get_the_date(); ?> to: <?php echo 'Last Updated ' . get_the_date(); ?> February 16, 2023 at 1:43 am #2535174 Ravi Saive @Fernando, Thanks, i modified the code to align it right side: <p style="text-align:right;"><?php echo '<strong>Last Updated:</strong> ' . get_the_date(); ?></p> February 16, 2023 at 1:44 am #2535175 Fernando Customer Support You’re welcome, Ravi! Author Posts Viewing 15 posts - 1 through 15 (of 15 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In