Mini Loops
maximum_age=1 behaviour (and a possible workaround) (1 post)

  1. kroom
    Posted 3 years ago #

    I'm using Mini Loops 1.1.1

    This could be related to this previous topic.

    Using maximum_age=1 in shortcode or in widget, I get today's but also yesterday's posts. Can't get if this is a feature or a little bug.
    In no way I'm a php programmer (so probably there are more elegant ways), but a little modify to line 149 in helpers.php did the trick:

    $mini_loops_minimum_date = date( 'Y-m-d', time() - ( $maximum_age * 24 * 60 * 60 ) +86400 );

    As you see, I simply added +86400 i.e. one day expressed in seconds (this is for the casual reader).
    Now, by setting maximum_age to 1, my miniloop seems to shows exactly what I want, i.e. only posts published today, skipping those posted yesterday.

    Please let me know if what I described (and coarsely corrected) was a bug, or if I'm missing something.
    One thing I couldn't have figured out yet is if "today" means "current date" or "last 24 hours". "Current date" would be my fav option.

    By the way, thanks for your plugin!


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Mini Loops
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic