Warning: Declaration of relatedpostsCPWidget::update($new_instance) should be compatible with WP_Widget::update($new_instance, $old_instance) in /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php on line 0

Warning: Cannot modify header information - headers already sent by (output started at /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php:0) in /home/nrtechweb/public_html/wp-content/plugins/cleantalk-spam-protect/cleantalk.php on line 649

Warning: Cannot modify header information - headers already sent by (output started at /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php:0) in /home/nrtechweb/public_html/wp-content/plugins/cleantalk-spam-protect/cleantalk.php on line 666

Warning: Cannot modify header information - headers already sent by (output started at /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php:0) in /home/nrtechweb/public_html/wp-content/plugins/cleantalk-spam-protect/cleantalk.php on line 673

Warning: Cannot modify header information - headers already sent by (output started at /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php:0) in /home/nrtechweb/public_html/wp-content/plugins/cleantalk-spam-protect/cleantalk.php on line 679
Wordpress custom media upload for frontend - NR Tech Web Solution | NR Tech Web Solution

Blog

WordPress custom media upload for frontend

As you know about WordPress has a great functionality that is to upload a file and manage files and image using WordPress media box image manager .

you have been using this media box in post or page and custom post type in admin section as featured image.

As i have been trying many more time on internet to find out the correct solution but i did not find correct solution that i want . finally i discovered  the right code that can be use on front or wherever you want to use this code. This is really simple  and short code that can easily implemented as per your requirement.

First In functions.php , you have to add or load some  JavaScript and CSS  that is very important to open media box.

So Now copy this code in functions.php file in your theme.

Now you load the JS and Css , its time to initialize wp media library in jQuery.

Now Its HTML where you can test this code. i used this code in custom template  , you can use this code any where  as you want .

You can add  this this template and create a page in admin and select example template  and update , now view this page.

Now your media code is ready .

Happy Coding !

Leave a Reply

Your email address will not be published. Required fields are marked *

Security *