Problem uploading files, after changing domain name
Well’ for anyone that faces this problem. look here: plesk-permissions-wordpress
Well’ for anyone that faces this problem. look here: plesk-permissions-wordpress
wp_get_attachment_image($post->ID, ‘size-1′); The “post thumbnail” actually gets the featured image that is attached to the post. For an attachment, you want the attachment itself in a specific size, which isn’t the same as the featured image.
I got the solution. I used the following script: WordPress Media Manager 3.5 – default link to and altered it to my needs with this modification: (function() { var _AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay; wp.media.view.Settings.AttachmentDisplay = _AttachmentDisplay.extend({ render: function() { _AttachmentDisplay.prototype.render.apply(this, arguments); this.$el.find(‘select.link-to’).val(‘none’); this.model.set(‘link’, ‘none’); this.updateLinkTo(); this.$el.find(‘select.link-to’).parent(‘label’).hide(); this.$el.find(‘select.size option[value=full]’).hide(); this.model.set(‘size’, ‘medium’); this.updateLinkTo(); } }); })();
Since I didn’t expected an answer to this question I tried it with wp_delete_attachment();. I wrote this function on a random page of my site (since the site isn’t live yet) and executed it from there. $attac_kill_ids = range(1235, 22686); //fill an array with the post_ids from the empty instances foreach( $attac_kill_ids as $kill_id ){ … Read more
Virtually all the core files and scripts that WordPress uses for displaying the media library are within the wp-admin folder, plus it uses various admin-only hooks, so using this on the front-end is pretty much out of the question. It’s not difficult to allow users to upload to the media library from the front end … Read more
However you can create plugin for that. From admin end, you can specify the folder path. From there videos can be loaded in your site. That’s all. You have to write all video supported format.
There were two minor mistakes in my previous answer: I forgot to trigger the change event for the parent. I called the function on every AJAX call, making other selections impossible. Here is the fixed code: <?php /** * Plugin Name: Pre-select post specific attachments */ add_action( ‘admin_footer-post-new.php’, ‘wpse_76048_script’ ); add_action( ‘admin_footer-post.php’, ‘wpse_76048_script’ ); function … Read more
I had this same problem. I couldn’t work out why some images I uploaded early in my development process where showing thumbnails and others uploaded later were showing the full image constrained to 120px wide. Finally realised it was because I disabled the Medium image size by setting both width and height to 0. It … Read more
Is there a way to force Featured image to show as attachement?
I’m guessing you’ll need to fetch the post content and parse it using something like this as a guide (pasted code from above link for future reference). // Get the all post content in a variable $posttext = $post->post_content; $posttext1 = $post->post_content; // search for the src=”” in the post content $regular_expression = ‘~src=”[^”]*”~’; $regular_expression1 … Read more