0
在我的WordPress的主頁,我使用如何從一個星期六顯示歸檔下週六範圍,WordPress的
wp_get_archives('type=weekly&format=html')
它輸出像
* July 19, 2010–July 25, 2010
* July 12, 2010–July 18, 2010
即從開始的功能顯示檔案星期一至下一個星期一。如何將星期六改爲星期六
在我的WordPress的主頁,我使用如何從一個星期六顯示歸檔下週六範圍,WordPress的
wp_get_archives('type=weekly&format=html')
它輸出像
* July 19, 2010–July 25, 2010
* July 12, 2010–July 18, 2010
即從開始的功能顯示檔案星期一至下一個星期一。如何將星期六改爲星期六
這取決於start_of_week
選項,您可以在下設置Sett 012>通用>本週開始。如果您不想更改此設置,則可以攔截撥打get_option
的電話以返回不同的內容。
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');