Hi @tooni,
Glad to know that the plugin has been helpful to you! Thanks for the kind words.
About displaying the last update date thing, it’s possible. I’m sure someone asked this question a long time ago, I just need to find the link haha. If I can’t find it then I can just show you how to do it.
I’ll leave a comment here explaining the details later, right now I’m taking a break from coding (had a long coding session yesterday, freelance work is unforgiving haha).
Didn’t forget about you @tooni, just been very busy lately 😛
Alright, since I couldn’t find the link let’s try something else (untested but it should work):
#1 Go to Plugins > Plugin Editor, select WordPress Popular Posts to edit the plugin.
#2 Click on scr > Output.php to edit this file.
#3 Find this line and replace it with return apply_filters('wpp_the_date', $date, $post_object->id);
#4 Add the following code snippet to your theme’s functions.php file:
add_filter('wpp_the_date', function($date, $post_id) {
return get_the_modified_time('d.M Y', $post_id);
}, 10, 2);
#5 Click on the Update File button to save changes.
Give that a try and report back your results.
Thread Starter
Tooni
(@tooni)
Thank you very much, Hector!
As far as I can see with a first check this works fine. Exactly what I wanted to see. 🙂
There is still a minor problem: The text before the date still says: “published on:” and I don’t know where to change it to “last updated on:” ?
And of course one more serious problem: I made my modifications on a test site, which is not my real site for public access. And I feel very very uncomfortable with editing plugin or theme files directly. Even if I would do it, I would loose my modifications with the next update.
So my hope was, that you could include this additional function into a next update of your plugin. 😉
Greetings, Tooni
There is still a minor problem: The text before the date still says: “published on:” and I don’t know where to change it to “last updated on:” ?
Ah, right, forgot about that. Should be easy to change though, however I’m AFK at the moment. Will come back later to help you sort this last obstacle.
(…) I feel very very uncomfortable with editing plugin or theme files directly. Even if I would do it, I would loose my modifications with the next update.
Yep, I generally discourage modding plugin files for this very reason.
So my hope was, that you could include this additional function into a next update of your plugin. 😉
That’s the plan 😉
Thread Starter
Tooni
(@tooni)
Thank you again for your support.
And: Don’t hurry – I will wait for an update.
Best regards, Tooni