• Resolved Tooni

    (@tooni)


    Hi Hector, at first I want to let you know that I really like your plugin! It never caused a problem and allowed me to create a separate page with my best postings.

    Also today I don’t have a problem but I want to ask you something:
    For my best-postings-page I’m using the wpp shortcut with several parameters. Two of those are: stats_date=1 stats_date_format=”d.M Y” .
    This works as expected. However, I would like to show the date, when the posting has been updated the last time (instead of when it was published). This information is available in the database and with some CSS rules I was already able to show this information on top of my normal postings.
    And now it would be very nice, if I could show this date also in my wpp-page.
    Do you see a possibility to provide this?

    Thanks, Tooni

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    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).

    Plugin Author Hector Cabrera

    (@hcabrera)

    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

    Plugin Author Hector Cabrera

    (@hcabrera)

    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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Possible to include date of latest update?’ is closed to new replies.