Support » Plugin: Recently » Modified Date vs Publish Date

  • Resolved hoko01

    (@hoko01)


    Hi Hector, you developed a cool plugin.

    But one thing is missing in my opinion. Could you add the ‘modified date’ as an option to use instead of the ‘publish date’. So also posts which are recently modified are shown in the plugin. If you could add this option, please add also the parameter ‘modified-date’ that can be displayed in the list.

    Thank you !

    Holger

    https://wordpress.org/plugins/recently/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Héctor Cabrera

    (@hcabrera)

    Hi Holger!

    Could you add the ‘modified date’ as an option to use instead of the ‘publish date’. So also posts which are recently modified are shown in the plugin.

    I didn’t try this but I believe it’ll work just fine (if it doesn’t, please let me know). Add the following snippet to your theme’s functions.php file:

    function recently_order_by_last_mod( $args ) {
        $args['orderby'] = 'modified';
        $args['order'] = 'desc';
    
        return $args;
    }
    add_filter( 'recently_query_args', 'recently_order_by_last_mod' );

    …please add also the parameter ‘modified-date’ that can be displayed in the list.

    For this one you’ll have to modify Recently’s code:

    1. Go to Plugins > Editor and select Recently from the dropdown.
    2. Find:
      $date = get_the_time( $instance['meta_tag']['date']['format'] );
      and change it to:
      $date = get_the_modified_date( $instance['meta_tag']['date']['format'] );
    3. Hit the Update file button to save changes.

    I’m posting this because when I built this plugin the original idea was to have it list the most recently published posts 😛 I might change my mind and add an additional option / feature to display the modified date in the future, but for now this will do.

    Make sure you bookmark this topic for future reference, or else next time you upgrade the plugin all changes to its code will be lost (which is why modifying a plugin’s code isn’t a good idea, but since I don’t plan to release a new version of Recently any time soon you should be safe for now).

    Hi Hector,

    your workaround works perfect for me. Thank you. I hope you will add this to your new version !

    Regards Holger

    An additional option to show the modified date, and order within that date would be great for me too – i’ve tried your workaround – at the moment it is fine… but an option would be fine

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Modified Date vs Publish Date’ is closed to new replies.