dongzhan1948 2010-07-20 09:32
浏览 21
已采纳

如何在下周六的一个星期六,Wordpress显示存档

In my wordpress home page, i am displaying the archives using the function

wp_get_archives('type=weekly&format=html')

and it outputs like

* July 19, 2010–July 25, 2010
* July 12, 2010–July 18, 2010

ie starting from monday to next monday.How can i change this from saturday to next saturday

  • 写回答

1条回答 默认 最新

  • dongye9453 2010-08-13 12:41
    关注

    This depends on the start_of_week option, which you can set under Settings > General > Week Starts On. If you don't want to change this, you could intercept the call to get_option to return something different.

    add_filter('pre_option_start_of_week', 'start_once_on_saturday');
    function start_once_on_saturday()
    {
       // Make sure we only do this once
       remove_filter('pre_option_start_of_week', 'start_once_on_saturday');
       return 6;
    }
    wp_get_archives('type=weekly&format=html');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?