Toolonomy Logo

Display Last Modified Date of Pages with Oxygen Builder

If you are wondering how to display your page's last modified/updated date along with or instead of the page published date in the Oxygen template, then in this post I will teach you how to do that using a code snippet within a few minutes.
Mohammed Wasim Akram
Blog Post Author
Last Updated: March 21, 2022
Blogpost Type:
0 Shares

If you are wondering how to display your page's modified/updated date along with or instead of the page published date in the Oxygen Templating, then in this post I will teach you how to do that within a few minutes.

You only need to know how to copy and paste the provided code snippet to your WordPress site using the Code Snippets, Advanced Scripts, or any other similar plugin.

Also, I assume that you are already comfortable with Oxygen Dynamic Data options as we are going to use that extraordinary feature to display the last modified date of the page to the Oxygen template.

Last Modified Date in Oxygen Templates - Image - SyncWin
  • Save

Even if you don't know how to use them properly still no worries, just follow the post carefully and I will teach you everything step by step.

Register a PHP Function To Display Last Modified Date in Oxygen Templates

The very first step is to install and activate the Code Snippets plugin, then add a new code snippet after that just copy the provided PHP code snippet you can find below and paste that to register a function to call the last modified date.

/* Display Last Modified Date in Oxygen Templates */

function syncwin_display_last_modified_date( ) {
return get_the_modified_time('F j, Y');
}

Special thanks to Matt Hias for helping me to improve the old bloated code snippet with a new optimized version.

Add The Page Modified Date Using Oxygen Dynamic Data Feature

The final step is to add a text element to your template and then select the texts and you will find an Insert Data button on top of the Oxygen editor.

Once you click that button you will see a pop-up window called Insert Dynamic Data, now just click over to the PHP Function Return Value button under the Advanced section.

Oxygen Dynamic Data Window for Text Element - Image - SyncWin
  • Save

Once you click on that option you will see two fields, the first one is a Function Name and the second one is the Function Arguments field.

In the Function Name field, you need to insert "syncwin_display_last_modified_date" which is our function name that you also can see in the first line of the code snippet I provided, now leave the second Function Argument field blank as we don't need that in this case.

Next just hit the Insert button on the same window and click the Save button from the top right corner of the Oxygen editor.

Now you can see the page Updated/Modified Date on the front-end of your Oxygen page once you reload the page.

Display-Image-PHP-Function-Return-Value-in-Oxygen-Dynamic-Data-Image-SyncWin
  • Save
The Navigation Should Look Like This:

> Open the Oxygen Editor
> Click the +Add Button
> Add a text element
> Double click on that particular element to select the texts
> Hit the Insert data button from the top of the page
> Select the PHP Function Return Value button under the Advanced section
> Insert 
"syncwin_display_last_modified_date" in the Function Name field
> Leave the PHP Argument field blank
> Hit the Insert button

> Save the Oxygen Template using the Save button from the top right corner

Conclusion

In this knowledgebase post, I have covered how to display the page updated/modified date to your Oxygen templating using a simple PHP function and dynamic data feature of Oxygen.

I believe this guide was helpful to you so if I am right and you think the same as I do, then please share it with your community so that they also can take benefit from this post.

Also if you have to say something then feel free to leave your valuable thoughts in the comment section.

Thanks for visiting Toolonomy.com!

0 Shares
Toolonomy Online Community Image
Join Toolonomy Community
Toolonomy Community is a dedicated place to explore the Discussion, Content, Deals & Hidden Details about the Business Development Tools that have the potential to help you succeed in your journey to Digital Entrepreneurship by letting you build, manage, and grow your Business Online with ease.
Free Membership
A Google & HubSpot Certified Digital Marketing Specialist, Self-Taught WordPress Expert, Useful BizDev (Business Development) Tools & Deals Explorer, and the Founder of SyncWin & Toolonomy.
Subscribe
Notify of
guest
13 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Catharina
2 years ago

Thanks for this snippet! It really helped me a lot. Could you please provide me with a small addition? I want the date shown in the german form, e.g. 30. März 2021 (month written the german word of the month and the year with 4 nummers). If I write d.m.y I only get 30.03.21

Thanks for your help 🙂

Matt Hias
Reply to  Catharina
2 years ago

Hi Catharina,

you can use 'd. F Y' as the format string in the function.

d = 2 digit day

F = full month name in your WordPress language (hopefully German?)

Y = 4 digit year.

See the PHP doc for details:

https://www.php.net/manual/de/datetime.format.php

Colin McDermott
Reply to  Catharina
1 year ago

If you Google "PHP date format" or "PHP date German" I am sure you will be able to figure it out. It uses universal PHP date format so you can just change it.

Colin McDermott
1 year ago

A simple article but really helpful, thanks Mohammed. I am trying to get this to help with Google.

Slavek
Slavek
1 year ago

Hi Mohammed, I'm not sure if my problem is relevant to this snippet, Oxygen or Polylang.

I use two languages – English and Czech. In English, I need to use this date format: 'F j, Y' – it works fine. In Czech, I need to use 'j. F Y'.
I tried translating F j, Y to j. F Y in Languages > Strings Translations but that didn't help. Any idea how to fix this?

I'm attaching some screenshots:
Code Snippet:comment image
English frontend (works fine):comment image
Czech frontend (missing the dot after day + extra comma after month):comment image

Ton Akveld
4 months ago

Hi Mohammed,

Simple enough, it seems, but all I see is the first creation date of the template, not the date of the latest update.

What am I doing wrong?

Ton Akveld
Reply to  Mohammed Wasim Akram
3 months ago

Hi Mohammed,

You're absolutely right. I started all over again and it works.
Haven't the faintest clue what went wrong the first time.

ThnX a lot!

Kind regards,

Ton

DaveC
DaveC
3 months ago

When implementing the snippet do you "Run snippet everywhere" or  "Only run on site front-end". Thanks

Related Blog Posts
Explore all the other related blog posts.
WordPress
Best WordPress Schema Markup Plugins: Structured Data Tools
Want to boost the SEO of your WordPress site? Look at these amazing schema-marking tools! Learn how to optimize your site's material for search engines and increase traffic to your sites....
WordPress
Bit Integrations Review: No-Code WordPress Automation Plugin
Are you looking for a powerful and easy-to-use WordPress automation plugin? Checkout Bit Integrations! It is a no-code robotic process automation plugin for WordPress that seamlessly connects your website to hundre...
WordPress
WordPress Header Disappeared: Restore Missing Theme PHP File
Get your disappeared WordPress header or footer back in no time with our step-by-step tutorial. Learn how to fix the vanished header or footer by restoring the missing theme PHP file with ease. Click now to bring y...
Explore Blog

Become a Toolonomy Community Member for Free!

Consider joining our Official Community Group if you want to get access to exclusive insider content and information about Exclusive Digital Tools and Technologies. Also, you will be able to get involved in interesting group discussions with like-minded people that are interested in similar topics as you.
Become a Member
Toolonomy Logo
Made with ❤ for Digital Tool & Tech Enthusiasts
Copyright © 2018 - 2023 by SyncWin | All Rights Reserved.
Top crossmenu
0 Shares
Copy link