Create featured image from a remote url when creating a post

The code worked for me; but I defined the function like this: function generate_featured( $post_id ), then I commented out the global $post;; and finally (although this is not mandatory..), in the $file_array, I set name like this: ‘name’ => basename( $image_url ), So: (Note that I intentionally didn’t include the whole code) function generate_featured( … Read more

Fullscreen Video/GIF Intro

The following code uses HTML5 Video, with the muted & autoplay attributes set. It takes the video, which I uploaded through the media gallery and displays it fullscreen. I’m using a script that detects when the video is done playing, then it fades out and is removed from the DOM. HTML <div class=”fullscreen-bg”> <video muted … Read more

How to add meta box for image upload using WordPress media uploader?

I found the best solution please check it: jQuery Code jQuery(function($){ /* * Select/Upload image(s) event */ $(‘body’).on(‘click’, ‘.misha_upload_image_button’, function(e){ e.preventDefault(); var button = $(this), custom_uploader = wp.media({ title: ‘Insert image’, library : { // uncomment the next line if you want to attach image to the current post // uploadedTo : wp.media.view.settings.post.id, type : … Read more

Set Maximum Width for an uploaded image

Full size images are unmodified by default as it literally is the full size image. You could ensure the photo is a suitable size prior to uploading or restructure your theme so that full size images are not linked and are perhaps replaced by large images which can have their size set in WP Admin.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)