Title: freido's Replies | WordPress.org

---

# freido

  [  ](https://wordpress.org/support/users/freido/)

 *   [Profile](https://wordpress.org/support/users/freido/)
 *   [Topics Started](https://wordpress.org/support/users/freido/topics/)
 *   [Replies Created](https://wordpress.org/support/users/freido/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/freido/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/freido/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/freido/engagements/)
 *   [Favorites](https://wordpress.org/support/users/freido/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Add form enctype](https://wordpress.org/support/topic/add-form-enctype/)
 *  [freido](https://wordpress.org/support/users/freido/)
 * (@freido)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/add-form-enctype/#post-1053483)
 * You can find one solution [here](http://wordpress.org/support/topic/352504).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Changing the form enctype dynamicly](https://wordpress.org/support/topic/changing-the-form-enctype-dynamicly/)
 *  [freido](https://wordpress.org/support/users/freido/)
 * (@freido)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/changing-the-form-enctype-dynamicly/#post-1345677)
 * Hello Kurak,
 * Here is a simple solution to your problem using jQuery:
 *     ```
       if ( is_admin() ) {
           function add_post_enctype() {
               echo "<script type='text/javascript'>
                         jQuery(document).ready(function(){
                             jQuery('#post').attr('enctype','multipart/form-data');
                         });
                     </script>";
           }
           add_action('admin_head', 'add_post_enctype');
       }
       ```
   
 * If you want to test for a particular admin page for example “add page” or “edit-
   page” here is a slightly improved version of the same script:
 *     ```
       if ( is_admin() ) {
           $current_admin_page = substr( strrchr( $_SERVER['PHP_SELF'], '/' ),1, -4 );
           if ( $current_admin_page == 'page' || $current_admin_page == 'page-new' ) {
               function add_post_enctype() {
                   echo "<script type='text/javascript'>
                             jQuery(document).ready(function(){
                                 jQuery('#post').attr('enctype','multipart/form-data');
                         });
                         </script>";
               }
               add_action( 'admin_head', 'add_post_enctype' );
           }
       }
       ```
   
 * Using this method you can add all sorts of attributes or html to the admin pages
   when and where needed.

Viewing 2 replies - 1 through 2 (of 2 total)