2

I'm using a theme that supports WordPress's (relatively new) video header feature. I want to upload a video that's over 8MB big, and I don't want to reduce the size of the video. How can I force it to accept a larger video? Is there a file that I can edit or a plugin that I can download?

1
  • It's a very bad idea to have such a heavy video header, as it will take long to load for end users. You can use a tool like videosmaller.com to compress it.
    – guidod
    Nov 9, 2017 at 20:57

2 Answers 2

2

The limit is enforced by _validate_header_video method, registered as validation callback on respective Customizer setting.

There is a filter that allows you to hook into the process and manipulate those arguments:

add_filter( 'customize_dynamic_setting_args', function ( $args, $id ) {

    if ( 'header_video' === $id ) {
        // change $args['validate_callback']
    }

    return $args;
}, 10, 2 );
2
  • Do I just put this code into functions.php? I don't really understand how to use this. Dec 12, 2017 at 10:09
  • Unfortunately you would probably have to rewrite that callback (make your own version of it) and replace original with it (using filter I've shown), since there is no easy way to just adjust the size check within it.
    – Rarst
    Dec 12, 2017 at 10:18
0

check your max_upload_size in your "php.ini" file.

check more on this. URL 1, URL 2,

Hope this will helps you.

3
  • I don’t believe this is the issue the OP is up against, though it may indeed also be a part of the problem. @Rarst, has another major part of the solution, IMHO.
    – orionrush
    Nov 7, 2017 at 19:19
  • when I faced this issue, I tried this solution. That's why I suggested.
    – Sunil Dora
    Nov 8, 2017 at 4:29
  • Not the issue in the question, out of the box video headers will restrict to 8MB even if you can upload larger file.
    – Rarst
    Nov 8, 2017 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.