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 … Read more

Add a file upload field

First do a var_dump on the $_FILES variable to check if the array key you are using is the correct one, and you should never just grab a variable that comes from user input and just use it, try doing a isset or empty before you use the variable. After you found what is the … Read more

Embed HTML5 files/subfolders in post?

This plugin should do exactly what you’re looking for: http://wordpress.org/plugins/shortcurl/ it will allow you to embed a shortcode in your post that should go grab external content and place it exactly how you’d like it to. Since it’s not an iFrame, you should also be able to style the content appropriately without much issue (if … Read more

Add SWF file to wordpress through custom template

wordpress is not alowing me to upload the swf file into the media library Actually you can insert this code to the functions.php: add_filter(‘upload_mimes’, ‘add_custom_upload_mimes’); function add_custom_upload_mimes($existing_mimes){ $existing_mimes[‘swf’] = ‘text/swf’; //allow swf files return $existing_mimes; } Then you try to upload your swf file to the media library. As for homepage, you can install a … Read more

Upload Directory question

try this way: function wp128084_upload_dir( $pathdata ) { // change path here return $pathdata; } add_filter(‘upload_dir’, ‘wp128084_upload_dir’); add this where you want to change upload directory then again remove filter to change to default wordpress directory remove_filter(‘upload_dir’, ‘wp128084_upload_dir’);