• Resolved tecklines

    (@tecklines)


    Hello

    Just a quick question, I am using this wonderful plugin in order to display a random article from my blog. I would like the random article to be one of the latest ones, randomly picked between those written during the current month.
    The only problem is that by using the month number, I also get articles from the same month but from 2016 instead of 2017. (I get also those from 2017)
    Any way I could specify current month or specify the month and the year?

    Thanks again I have been looking for ages for such a plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter tecklines

    (@tecklines)

    Ok forget about it, I didn’t catch this was based on a WP Query, added the year to the url as a parameter and everything is working as expected

    You rock!

    Plugin Author Christoph

    (@camthor)

    Thanks! Glad you already found a solution!

    But it’s an interesting question anyway – how to use relative dates. It should be possible. I would have to modify the plugin a bit, add ‘date_query’ and then there could be something like ‘after’ => ‘1 month ago’. I will try to add that as new feature once I have some free time. 🙂

    Thread Starter tecklines

    (@tecklines)

    Thanks or the feedback Chris,yes relative dates would be a great implementation as this is really what I am trying to achieve, to have an url that would display a random news from the current month pool.
    For now I will just change the month number every month, no big deal this is already a miracle solution 🙂

    Plugin Author Christoph

    (@camthor)

    I’m currently adding and testing the new parameter for the relative dates. It will allow to use “before” and “after” (?redirect_to=random&date_query_after=1%20month%20ago or ?redirect_to=random&date_query_before=last%20monday), but nothing more complicated because it would be quite difficult to send nested queries through the URL.

    Should be available during the next days.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Redirect to current month’ is closed to new replies.