How to register images uploaded via FTP in media library?

It’s because you’re not registering them as a media type. Every upload is a WordPress post of the attachment type. To start, it would be something like this: $file_name=”Some Name”; $file_path=”/path/to/uploads/2012/08/04/newfile.jpg”; $file_url=”http://url/to/uploads/2012/08/04/newfile.jpg”; $wp_filetype = wp_check_filetype($file, null); $attachment = array( ‘guid’ => $file_url, ‘post_mime_type’ => $wp_filetype[‘type’], ‘post_title’ => $file_name, ‘post_status’ => ‘inherit’, ‘post_date’ => date(‘Y-m-d H:i:s’) … Read more

There’s a way to scale media (images) at 50%?

You can use image_downsize filter and to catch when WordPress wants a downscaled image and not original, and actually a size what doesn’t exist. add_filter( ‘image_downsize’, ‘wpse_60890_retina_scale’, 10, 3 ); function wpse_60890_retina_scale( $value, $id, $size ) { if ( $size == ‘wpse_60890_retina_scaled’ ) { if ( !is_array( $imagedata = wp_get_attachment_metadata( $id ) ) ) return … Read more

add_image_size() zoom-crop

Currently, WordPress core image handling/thumbnail creation does not perform zoom-crop. If you need an intermediate image size to be created explicitly, you will need to ensure that you upload an image with equal or larger dimensions as the intermediate image size.

replace wp_get_attachment_image with my own function

There is a filter, wp_get_attachment_image_attributes, for the image attributes– a well designed one too. function alter_att_attributes_wpse_102079($attr) { $attr[‘data-src’] = $attr[‘src’]; return $attr; } add_filter( ‘wp_get_attachment_image_attributes’, ‘alter_att_attributes_wpse_102079’); That will add the data-src attribute. That looks like what you need. You could add more attributes, or alter the existing onese, if you need.

How to paginate attachments in a secondary query as gallery?

I’m assuming you want something like this: |———————| | content | | (static) | |———————| | gallery | | (paged) | |———————| | << pagelinks >> | |———————| In this setup your the post content stays the same, appears to be static, while the gallery is paged. This means you have the main query, showing … Read more

Specify image dimensions

In your theme’s functions.php file you can add add_image_size( ‘thumb’, 600, 350, true ); add_image_size( ‘thumbnil’, 600, 350, true ); add_image_size( ‘medium’, 600, 350, true ); add_image_size( ‘large’, 600, 350, true ); add_image_size( ‘post-thumbnail’, 600, 350, true ); add_image_size( ‘{custom-image-type}’, 600, 350, true ); For more information have a look at http://codex.wordpress.org/Function_Reference/add_image_size

Responsive Images

To add to the answer from @cristian.raiber, there is no function in WordPress or php to detect screen sizes, and there will in all probabilty never be such functionality. Php runs server side, which runs before clients side which is browser side. As for php, and for that matter WordPress, I cannot see any future … Read more