New answers tagged

-1

1: Theme Functions File There are cases where we have seen that just by adding the following code in the theme function’s file, you can increase the upload size: @ini_set( 'upload_max_size' , '64M' ); @ini_set( 'post_max_size', '64M'); @ini_set( 'max_execution_time', '300' ); 2. Create or Edit an existing PHP.INI file In most cases if you are on a ...


2

You can hook into upload_size_limit and set a maximum filesize: // Change the upload size to 1MB add_filter( 'upload_size_limit', 'wpse_228300_change_upload_size' ); function wpse_228300_change_upload_size() { return 1000 * 1024; }


3

Yes, you can use the wp_handle_upload_prefilter that allows you to stop the uploading process if a specific condition is not accomplished. In your case, you could try this code snippet: function limit_upload_size( $file ) { // Set the desired file size limit $file_size_limit = 1024; // 1MB in KB // exclude admins if ( ! current_user_can( ...


0

You don't give enough details but your image naming is just bad for wordpress. I am not sure if anywhere in core there is code that tries to detect a resolution by the filename suffix but it is a fragile and confusing habit. If you have to have the data in the name maybe use underscore instead.


0

The theme was auto generating alternative image sizes for responsiveness, so my newly named images were actually duplicates. Leaving this up in case anyone makes same mistake and stumbles across this.


0

I think the best solution for this is the plugin Real Media Library: http://codecanyon.net/item/wp-real-media-library-media-categories-folders/13155134 It can organize the media library with folders. The words of the product description says all: Turn your WordPress media library to the next level with folders / categories. Get organized with thousands ...


1

That's the same media manager. The first image is what you see if you try to put a gallery into your page or post. The second is what you will see if you add a Featured Image, where the gallery tab would not be relevant.


0

This may be due to a failed network request from the server to youtube. If the server cannot reach YouTube, the embed will show as "failed to embed" in the editor. You can fix the problem by allowing the server to make network requests to youtube. The WordPress Proxy documentation may be helpful, ...


0

In your functions.php you want to issue a call to set_post_thumbnail_size() https://codex.wordpress.org/Function_Reference/set_post_thumbnail_size As with add_image_size, you provide the target width, height & whether you want the image hard cropped to these dimensions. So, for example, set_post_thumbnail_size(427, 427, true); will crop all your ...


2

If you add this to functions.php, this will update the options as set. function custom_image_size() { // Set default values for the upload media box update_option('image_default_align', 'center' ); update_option('image_default_size', 'large' ); } add_action('after_setup_theme', 'custom_image_size'); You can update the options as you need.


1

I highly recommend updating all of your URLS. This can be done either with a word press plugin such as Velet Blues Update URLS Or via your SQL database: UPDATE wp_posts set post_content=REPLACE(post_content, 'www.live.com/', 'www.test.com/'); note* images are uploadeded as posts in your database.* ( wp_posts table with a post_type of "attachment". )


0

MP3 Playlists have a .m3u extension. I'm guessing that your Media Library is not registering the MP3s but the playlists instead, so they may physically be in that location, but not in the database. One work around if you know the names of the files could be to try using the PHP id3_get_tag() function. Read more here: ...


1

Well I was privileged enough to get the tumbleweed badge for this question. But I found the answer. Easy enough. Custom Upload Dir Plugin. Perfect for the job. Well, almost. With a little tweaking.


0

It turns out this is easily solved by creating a file attachment.php and redirecting to the file itself. Create an attachment.php file in your WordPress theme folder Put this code in the file <?php wp_redirect(wp_get_attachment_url(), 301); ?> Upload it and there you go This link explains in full.


1

If you are not very familiar and want a plugin that can do all that for you using drag and drop, try WP-TYPES and their CRED plugin. Just don't mind their support, it's really frustrating.


2

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 see what's wrong here? At ...


1

As per the given url http....url.../author/name?MediaTag=tag1, below code may helpful... if(isset($_GET['MediaTag'])) //It will check the value of MediaTag (from address bar after ?) { $tag1 = $_GET['MediaTag']; //Assigning value of MediaTag to the variable if($tag1) //Checking if variable have some value or not { ...



Top 50 recent answers are included