• Hi,

    I am using the WTI Like Post Plugin. This plugin includes a widget that displays the most liked posts of a certain time range. Problem is, the set time ranges are by days. This means when you select most liked posts as of one month ago, this pulls all the posts from the last 30 days. I want it to pull the posts starting from the beginning of the month. So instead of it pulling December 7-January 6, I would like it to reset and pull January 1-January 6.

    The current time selection in the widget is written like this:

    `global $MostLikedPosts;
    $time_range_array = array(
    ‘all’ => __(‘All time’, ‘wti-like-post’),
    ‘1’ => __(‘Last one day’, ‘wti-like-post’),
    ‘2’ => __(‘Last two days’, ‘wti-like-post’),
    ‘3’ => __(‘Last three days’, ‘wti-like-post’),
    ‘7’ => __(‘Last one week’, ‘wti-like-post’),
    ’14’ => __(‘Last two weeks’, ‘wti-like-post’),
    ’21’ => __(‘Last three weeks’, ‘wti-like-post’),
    ‘1m’ => __(‘Last one month’, ‘wti-like-post’),
    ‘2m’ => __(‘Last two months’, ‘wti-like-post’),
    ‘3m’ => __(‘Last three months’, ‘wti-like-post’),
    ‘6m’ => __(‘Last six months’, ‘wti-like-post’),
    ‘1y’ => __(‘Last one year’, ‘wti-like-post’)
    );`

    Is there a way I can change this to include a function to pull from the 1st of the current month?

    Thanks for any help on this!

  • The topic ‘Code to collect data starting from the beginning of the month’ is closed to new replies.