Attachments without images

Then you should use custom fields, attachments are for something to attach from your media library. Custom fields on the other hand can be anything you want. http://codex.wordpress.org/Custom_Fields For a plugin I recommend , http://wordpress.org/extend/plugins/custom-field-template/

How to list “invisible” Auto Drafts?

try pasting this in your theme’s functions.php file add_filter( ‘parse_query’, ‘display_autosave_and_revisions’ ); function display_autosave_and_revisions( $query ) { global $pagenow,$typenow; if ( is_admin() && $pagenow == ‘edit.php’ && $typenow == “post”) { $query->query_vars[‘post_type’] = array(‘revision’,’post’); $query->query_vars[‘post_status’] = ‘any’; } }

Output posts attached images as thumbnails linked to full-size with lightbox class

Thanks to @Rarst who led me in the right direction to answer this question! What do you get if you var_dump() return of what doesn’t work, especially wp_get_attachment_img_src()? Do you have WP_DEBUG enabled? – Rarst function product_images() { global $post; $attachments = get_posts( array( ‘post_type’ => ‘attachment’, ‘posts_per_page’ => 0, ‘post_parent’ => $post->ID, ‘exclude’ => … Read more

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’

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