This commit is contained in:
spirit 2019-09-10 20:24:13 +08:00
parent b8d52760da
commit d6fd57480e
1 changed files with 5 additions and 9 deletions

View File

@ -40,18 +40,14 @@ function get_avatar_profile_url(){
/* /*
* 首页随机背景图 * 随机图
* NB: I can think of this
*/ */
function get_random_bg_url(){ function get_random_bg_url(){
$arr = array(); if ( empty( akina_option('default_feature_image' )) ) {
for($i=0; $i<6; $i++){ return get_template_directory_uri().'/feature/index.php?'.rand(1,1000);
if(akina_option('focus_img_'.$i)){ } else {
$arr[] = akina_option('focus_img_'.$i); return akina_option('default_feature_image').'?'.rand(1,1000);
} }
}
$url = rand(0, count($arr)-1);
return $arr[$url];
} }