Upload images using FTP and show them in media

I know it’s one year old but just in case someone else is also searching: You could upload the main files (not all 3 sizes, just the original images) via FTP to another directory on your server and then use the Add-From-Server Plugin.

The WordPress Gallery, Grabbing The Link and Images?

Attachments in a gallery are their own posts, with some special settings. To get a list of all the attachments for a given post, you basically just create a new query and specify the post parent and attachment type. $gallery_images = new WP_Query(array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘post_status’ => ‘inherit’, … Read more

copy attachment title to description and alt text

You can make a query to loop through all the attachments, and then update the attachment info for each attachment in the while loop. Something like $args = array( ‘post_type’ => ‘attachments’, ‘post_status’ => ‘any’, ‘posts_per_page’ => -1, ) $query = new WP_Query($args) if($query->have_posts()): while($query->have_posts()): $query->the_post(); // 1. Get the attachment filename here and store … Read more

Dynamic-Image-Resize Plugin does not output anything

Ask the right guy Which you just did, so… here’s your answer from the developer. 🙂 What does the right output tell us? First of all, the public dynamic_image_resize() API function is just a wrapper for the singleton itself. When you take a closer look at the class, you’ll notice a __toString() method, which is … Read more

How to add php to theme to show alt attributes

Try adding these codes to your theme’s function.php file: function isa_add_img_title( $attr, $attachment = null ) { $img_title = trim( strip_tags( $attachment->post_title ) ); $attr[‘title’] = $img_title; $attr[‘alt’] = $img_title; return $attr; } add_filter( ‘wp_get_attachment_image_attributes’,’isa_add_img_title’, 10, 2 );

Prevent Width and Height Attributes in Image Tag Output

Use wp_get_attachment_image_src() and build a simplified img element. You may use something like the following code as a replacement for wp_get_attachment_image(): function wpse_53524_get_image_tag( $attach_id, $size, $icon, $alt=”” ) { if ( $src = wp_get_attachment_image_src( $attach_id, $size, $icon ) ) { return “<img src=”https://wordpress.stackexchange.com/questions/53524/{$src[0]}” alt=”$alt” />”; } } Put the function above into your theme’s functions.php. … Read more

Caption in Page adding unwanted 10px to width

Here’s what you can do. There’s a filter at the beginning of the shortcode execution function for the front end that will let you hijack the captions. Returning a non-empty value will stop execution of the shortcode, so if you just process the shortcode the way you want it to be processed and return that … Read more

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