- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
WordPress. How to fix Image Uploader issue
January 15, 2013
This tutorial shows how to fix Image Uploader issue in WordPress 3.5.
This issue may occur if you are using WordPress 3.4 template with WordPress 3.5 engine. Unfortunately, Image Uploader used in our WordPress 3.4 templates is not compatible with WordPress 3.5. You can just disable it and use Add Media button instead.
In order to get rid of this issue we need to modify theme-postmeta.php and theme-portfoliometa.php template files. After that we should use WordPress image uploader.
1. Open themeXXXX/includes/theme-postmeta.php file in the editor. Please note that XXXX are actual theme numbers. Go to line 397 and remove the following code:
/*-----------------------------------------------------------------------------------*/ /* Queue Scripts */ /*-----------------------------------------------------------------------------------*/ function tz_admin_scripts() wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); wp_register_script('tz-upload', get_template_directory_uri() . '/includes/js/upload-button.js', array('jquery','media-upload','thickbox')); wp_enqueue_script('tz-upload'); } function tz_admin_styles() wp_enqueue_style('thickbox'); } add_action('admin_print_scripts', 'tz_admin_scripts'); add_action('admin_print_styles', 'tz_admin_styles');
2. Open themeXXXX/includes/theme-portfoliometa.php file.
2.1. Go to line 61 and remove the following code:
$meta_box_portfolio_image = array( 'id' => 'tz-meta-box-portfolio-image', 'title' => __('Image Uploader', 'my_framework'), 'page' => 'portfolio', 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( "name" => '', "desc" => '', "id" => $prefix . "portfolio_upload_images", "type" => 'button', 'std' => 'Upload Images' ) ) );
2.2. Go to line 146 and remove the following code:
//If Button case 'button': echo ''; echo '', ''; break;
2.3. Go to line 410 and remove this code:
/*-----------------------------------------------------------------------------------*/ /* Queue Scripts /*-----------------------------------------------------------------------------------*/ function tz_admin_scripts_portfolio() { wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); wp_register_script('tz-upload', get_template_directory_uri() . '/functions/js/upload-button.js', array('jquery','media-upload','thickbox')); wp_enqueue_script('tz-upload'); } function tz_admin_styles_portfolio() { wp_enqueue_style('thickbox'); } add_action('admin_print_scripts', 'tz_admin_scripts_portfolio'); add_action('admin_print_styles', 'tz_admin_styles_portfolio');
3. Save changes and upload modified files.
4. Refresh the page and use WordPress image uploaded in order to upload the images.
Please note that lines of code can be different in your specific template. Just search for code you need to remove using search function of your editor.
Feel free to check the detailed video tutorial below: