WordPress.org

Ready to get started?Download WordPress

Forums

Recent Posts Widget Extended
[resolved] Absolute date? (8 posts)

  1. naoeobvio
    Member
    Posted 9 months ago #

    Hi, buddy. To me, your plugin is the best Recent Posts plugin already, lacking one feature, I dare to say: absolutre date. Is it possible to implement that?

    Thanks.

    http://wordpress.org/extend/plugins/recent-posts-widget-extended/

  2. troy7890
    Member
    Posted 9 months ago #

    Same request for me.

    I see the code here is what needs to be edited - perhaps someone can figure out what to change it to.

    widget-recent-posts-extended.php

    <?php if ($date == true) { ?>
    							<span class="rpwe-time"><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . __(' ago', 'rpwe'); ?></span>
    						<?php } ?>
  3. troy7890
    Member
    Posted 9 months ago #

    Follow up - after tinkering I've figured it out.

    Change the above code to

    <?php if ($date == true) { ?>
    	<span class="rpwe-time"><?php echo get_the_date(); ?></span>current_time('timestamp')) . __(' ago', 'rpwe'); ?></span>
    	<?php } ?>
  4. naoeobvio
    Member
    Posted 9 months ago #

    Thanks troy7890 for the response. In fact, there's a leftover in your code, probably a copy/paste error. This code works.

    <?php if ($date == true) { ?>
    <span class="rpwe-time"><?php echo get_the_date(); ?>
    <?php } ?>

    Thank you very much.

  5. troy7890
    Member
    Posted 9 months ago #

    Wow yeah, I really did paste that in wrong and didn't bother to check it afterwards. Sorry about that.

    So just replace what's on line 104 of widget-recent-posts-extended.php with this
    <span class="rpwe-time"><?php echo get_the_date(); ?></span>

    Glad I could help.

  6. Satrya
    Member
    Plugin Author

    Posted 9 months ago #

    Hmmm.. Maybe in the future I should offer to change the date settings. For everyone who needs to change the date output, the code from @troy7890 and @naoeobvio should works.

    Thanks to both of you.

  7. naoeobvio
    Member
    Posted 9 months ago #

    @troy7890

    Ops, I cut the span tag in the end. Thanks for the corrected code.

    @satrya

    An option would be nice, since your plugin is the best Recent Posts I could find. But I can't ask for more, it's great as it is. And as a workaround I made a copy of the plugin, renamed the plugin and widget adding ┬┤Fixed Date┬┤ to both, so I can use them in diffenrent ocasions.
    Thank you very much for your support.

  8. Satrya
    Member
    Plugin Author

    Posted 8 months ago #

    Please update to 0.8, I already added the absolute date option ;)

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.