How to change archieve frequency of the media file in uploads folder for wordpress blog

Assuming you want to set your weekly changing subdirs like, eg ‘2013/W35’ /where 35 stands for 35th week of 2013 ('W' param of php date() function),

you can use:

add_filter('upload_dir', 'set_folder_to_week', 999);

function set_folder_to_week ( $upload_data ) {
  $y = date('Y');
  $w = 'W' . date('W');
  $subdir = "/$y/$w";
  $dir = $upload_data['basedir'] . $subdir;
  $url = $upload_data['baseurl'] . $subdir;
  return wp_parse_args(array('path'=>$dir, 'url'=>$url, 'subdir'=>$subdir), $upload_data);
}

All media uploaded before still continue to be founded and displayed correctly by wordpress (if they are retrieved using the proper wp functions).

Note that I’ve added 'W' before week number in subdir name to avoid, on the first 12 weeks, url and path are the same of the standard /year/month path.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)