Uploading dwg files to wordpress

Your code should work just fine. The only problem in there is that you’ve set incorrect mime type, I guess… It should be image/vnd.dwg. So this one should work: function custom_upload_mimes ( $existing_mimes=array() ) { $existing_mimes[‘dwg’] = ‘image/vnd.dwg’; return $existing_mimes; } add_filter(‘upload_mimes’, ‘custom_upload_mimes’);

Cannot upload .mp3 file to wordpress media

you need to allow them to be uploaded in your media files. you can add following code to your themes functions.php function my_mime_types($mime_types){ $mime_types[‘mp3’] = ‘audio/mpeg’; return $mime_types; } add_filter(‘upload_mimes’, ‘my_mime_types’, 1, 1); there is more information about adding new mime types in WP here: https://wpsmackdown.com/add-remove-filetypes-wordpress-media-library/#add-filetypes And here a list of the mime_types: https://feedforall.com/mime-types.htm

Display “large” image size and show caption in attachment page

I’ve tested the following and it works for me. This uses the image’s Title for the ‘alt’ text and displays the image’s caption below the image itself. Use this in content-attachment.php, replacing the current the_content function: $attachment_id = get_the_ID(); // If this attachment is an Image, show the large size if ( wp_attachment_is_image( $attachment_id ) … Read more

File Type Is Not Permitted – Cronjob

Defining ALLOW_UNFILTERED_UPLOADS isn’t enough anymore: it doesn’t grant the capability, it just permits non-admin users who have the unfiltered_uploads capability to upload any file (except on a multisite). You also need to grant yourself the capability, e.g. from Sebastian’s answer here # # For this, see: wp-includes/capabilities.php > map_meta_cap() # function wpse_6533_map_unrestricted_upload_filter($caps, $cap) { if … Read more

Float images in content

You need to setup CSS settings for alignleft class of your theme: .alignleft, img.alignleft { /* … */ display: inline; float: left; /* … */ } And you need to add editor stylesheet where the same CSS will be presented. Create editor-style.css file in your theme, put content CSS settings there and call add_editor_style(); from … Read more

How do I modify the url of uploaded media content?

Use a plugin like Deploy Helper. Essentially, it allows you to swap out all instances of one URL with another, and will also handle serialized data. Just enter the old URL as media.detailsofmylife.net/uploads and the new one as www.detailsofmylife.net/wp-content/uploads. Make sure you also reset your custom upload paths. If you’d defined constants like WP_CONTENT_URL or … Read more

Insert Image automatically when upload finishes wordpress media uploader

The hook for doing stuff after an upload is the reset event on wp.Uploader.queue triggered by the pluploader when it’s finished (see line 249 in “wp-includes/js/plupload/wp-plupload.js”). Here’s one hack to use this to do an auto-insert after an upload: function wpse167143_admin_footer() { ?> <script> jQuery( document ).ready(function() { typeof wp.Uploader !== ‘undefined’ && wp.Uploader.queue.on( ‘reset’, … Read more

media sideload image not working with JPG file

You should check for the special characters in url, sometimes url structures may contain special characters like space, &, ‘ . use str_repalce to replace known special characters or urlencode. media_sideload_image works properly with JPG as well so either url contains special characters. If you can access image through url there is not a permission … Read more

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