Upload images and attachments from frontend form

I mentioned in a comment how it’s important to debug your code. Here’s why: The images are added first. In the image adding section, you’re running this line of code: $_FILES = array(“moreimages” => $image); Then when you get to your routine that adds the files, you start with this: $files = $_FILES[‘morefiles’]; Can you … Read more

Add visual editor to Media Edit Screen

This function added to functions.php does exactly that: // Enables Editor in Media edit screen. function add_editor_support_for_attachments($settings) { if( get_post_type() == ‘attachment’){ $quicktags_settings = array( ‘buttons’ => ‘strong,em,link,block,del,ins,ul,ol,li,code,close’ ); $settings = array( ‘wpautop’ => true, ‘textarea_name’ => ‘content’, ‘textarea_rows’ => 10, ‘media_buttons’ => false, ‘tinymce’ => true, ‘quicktags’ => $quicktags_settings, ); return $settings; } } … Read more

where can i add custom script to stop header video from autoplay

If you have your own theme or a child theme then you can add this in script tags to one of your templates. I’d suggest your footer template, just after the call to <?php wp_footer(); ?> <script> jQuery( document ).ready( function() { jQuery( document ).on( ‘wp-custom-header-video-loaded’, function() { jQuery(“#wp-custom-header-video”).attr(‘autoplay’,false); }); }); </script> Note that I’ve … Read more

Upload mobi and epub file in the MEDIA of WP

Sounds like you need something like: add_filter(‘upload_mimes’, function ( $mimes = array() ) { $mimes[‘mobi’] = ‘application/x-mobipocket-ebook’; $mimes[‘epub’] = ‘application/epub+zip’; return $mimes; } ); to support the uploads, but you might have to adjust the mime types to your needs.

Media sizes aren’t being created – server config?

It looks like “Easy Apache” handles both Apache and PHP. Only a guess, but you have recompiled Apache/PHP without the needed image libraries– either GD or ImageMagick. Without those, the server cannot physically resize images. You can use a phpinfo() script to see if the libraries are present. If not, you will need to recompile– … Read more