Pull images from the gallery

Use get_children() (Codex ref): $images = get_children( array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’ ) ); The first image will be $images[0]. EDIT: And by “first image”, I mean, the $ID of the first image, which you can use with any of the myriad image- and … Read more

Control attachments menu order with jQuery Sortable

To save the menu order use wp_update_post() with each attachment ID and its new menu position: $thisattachment = array(); $thisattachment[‘ID’] = $thisid; $thisattachment[‘menu_order’] = $new_menu_position; wp_update_post($thisattachment); EDIT – assuming these are already attachments and you’re updating them? Otherwise you have to insert the attachments first with wp_insert_attachment

attachment.php code or tutorial

This is part of the WordPress template system, it allows you to drill down and further customize output based in the template hierarchy, for instance if you want the attachments to have separate functionality/style then your single.php, you simply create attachment.php or go even further with MIME_type.php (like images). http://codex.wordpress.org/images/1/18/Template_Hierarchy.png Also you have 4 url … Read more

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