How Do I Add the Media Button in WordPress?

Adding a media button to a WordPress website is easy. All you need to do is add the following code to your theme’s functions.php file:

add_action(‘admin_init’, ‘add_media_button’);

Then, in your WordPress admin area, go to Appearance → Widgets and add a new widget. In the widget area, add the following code:

Finally, in the add_media_menu action, add the following code:

  • ” alt=”” />
  • That’s it! Now you can add a media button to any page on your site by simply entering the page’s title in the tag’s href field and providing the appropriate image file.