Tag Info

New answers tagged

1

Before all of that, I would recommend trying Image Rotation Repair plugin.


0

You can get it with: wp_get_attachment_url(); More info in the codex In your example: $attachment_id = media_handle_upload( 'my_image_upload', $_POST['post_id'] ); $attachment_url = wp_get_attachment_url($attachment_id); echo $attachment_url;


0

You need to add the folder that your css is in, so it might look like this if your styles were in 'css': wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/css/style.css' );


0

I managed to resolve this problem with changing Apache server configuration: there is a KeepAlive flag which needs to be turned Off. More about this flag: Apache Optimization: KeepAlive On or Off?


0

I ran into the same problem and tried doing a google search and came up with so many technical suggestions that I could not begin to even start as I'm not tech savvy. I did run into an article where a blogger said she contacted her hosting server and they changed the PHP version. It may or may not work for me but I was going to try. Only I didn't know how ...


0

Firstly, it is not recommended to use WP_PLUGIN_URL constant, instead use plugins_url() function. Second thing, it will not work when you put your files in the theme. You must put the necessary folder and file in the plugin if have to use this constant or function. Make sure, you have put correct path and you JS file is being loaded properly. ...


0

Based on your code, you have put the wrong condition within if statement. You can check the first example here: Media handle upload


0

So I dont know if its the best way but my problem was the if statement surrounding the require_once on the necessary files that contain the function. Commented out the IF statement and it did the trick. I'll go have that coffee now ;) //if (!function_exists('wp_generate_attachment_metadata')){ require_once(ABSPATH . ...


1

There is a simple approach to hold download access on your file. 1. Using .htaccess: Upload a .htaccess file into your wp-content folder. Have a look if one exists already, then append this code to the end of the file. If you don’t have one, just create a new blank file and add this code to it: RewriteEngine On RewriteCond %{HTTP_REFERER} ...


0

Try, if ( is_admin() ) return $file; instead. Basically you should always return the filtered content, otherwise you effectively have filtered the $file to nothing.


0

Change upload directory for PDF Files seems to be a good stepping stone forward. Although untested, looking at the code my adaptation would be along the lines of... <?php add_filter('wp_handle_upload_prefilter', 'custom_media_library_pre_upload'); add_filter('wp_handle_upload', 'custom_media_library_post_upload'); function ...


0

If those images have been inserted in your posts, deleting them from the Media Library will cause blank spaces with a broken image icon to appear in your posts. If you need/want to add alt text or change image file names, etc., better to do so directly in the Media Library than to delete existing images and then upload them again. If you do this, you will ...


2

AFAIK, this 2Mb limit is not set by Wordpress, but rather a php default limit set in php.ini. As for the specific reason why, I cannot tell you, but my guess would be that it has something to do with webhosting companies. Before you change any of the defaults like upload size, it is always always a good idea to check with your host and checking what are ...


1

There's no harm increasing file upload size. Now-a-days we all need to increase it as the default is insufficient. Please feel free to increase it. You can also talk with your hosting provider to increase the upload size. There are many ways to do so. Locate theme's function and add below lines: @ini_set( 'upload_max_size' , '64M' ); @ini_set( ...


0

It seems like you are creating the folder on main site and trying to read from it on a sub site. This is not the right way to go, remeber that on multisite each site, except for user management, is almost 100% isolated full wordpress that has no easy access to data from other sites. Assuming there should be only one such file in the system, What you ...


0

You can try this plugin: https://wordpress.org/plugins/optimize-images-resizing It resizes images based on your registered image size, but only when needed. Also can cleanup existing image sizes so they can regenerate.



Top 50 recent answers are included