• When I change the week to start on Sunday in the General options, the output list on my archives page shows the proper dates for those weeks (Sunday-Saturday):

    https://www.jordanisyourhomeboy.com/archives.php

    However, when you click on a link, it still displays the posts from that week from Monday-Sunday. For instance, when you click on “July 9, 2006–July 15, 2006”, it shows posts from July 10, 2006-July 16, 2006. Is there another setting I have to fix to make this work properly, or is it a bug?

Viewing 1 replies (of 1 total)
  • Thread Starter JMusic

    (@jmusic)

    Found out what to edit manually to fix this.

    In classes.php, at line 399, it says this:

    $where .= " AND WEEK(post_date, 1)='" . $q['w'] . "'";

    The “1” indicates Monday, meaning that no matter what settings you have in General Options, it will always show 7 days posts starting on Monday. To fix it, I just replaced the “1” with a “0” (Sunday).

    There should be a way to check your settings for “start_of_week” and place that there, but I originally tried the following code and it DID NOT WORK:

    $start_of_week = get_settings('start_of_week');
    $where .= " AND WEEK(post_date, $start_of_week)='" . $q['w'] . "'";

    When using that code, it just defaults to Sunday (which is what I wanted anyway, but if you want a day other than Sunday that code won’t do anything).

    Is there anywhere that I can post this as a bug report that WordPress will fix in the next release?

Viewing 1 replies (of 1 total)
  • The topic ‘Archives not working properly when starting week on Sunday’ is closed to new replies.