How to get post id of first child of the same post type?

Instead of: $args = array( ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order’, ‘post_type’ => ‘attachment’, ‘post_parent’ => $post->ID, ‘post_mime_type’ => ‘image’, ‘numberposts’ => 1, ); Use: $args = array( ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order’, ‘post_type’ => get_post_type($post), ‘post_parent’ => $post->ID, ‘numberposts’ => 1, ); You could also use post/page/etc or ‘any’

How to post images on my blog with a pre-defined border

this is more a css problem than wordpress related – check style.css of your theme: the ‘border’ (actually a padding with background image) is only set for left, right, and center aligned images (like those from your first link), not for those with .alignnone (those from your second link): #content img.alignleft, #content img.alignright, #content img.aligncenter … Read more

Looking for a photo management solution

WordPress is quite limited when it comes to managing media, it has no real media API, your best to look for a solution that specializes in photos, like Picasa, Smugmug, iPhoto, jalbum, etc. You can also integrate these services into WordPress since some of them have an API. If you need more features you should … Read more

wp_get_attachment_image_src() with advanced custom fields returning empty

What’s in get_sub_field(‘image’)? wp_get_attachment_image_src() parameter 1 should be the attachment id, not the attachment src, if that’s what you have. I use the following function to get an attachment ID from an image url as as far as I know WP doesn’t have a method for this at present. function get_attachment_id_from_src ($src) { global $wpdb; … Read more