Right now I have several images attached to my page, but I only want four of them to display in a slideshow, and then the other ones are referenced within the page's visual/html box. The problem is currently all my images attached to the page have a post type of "attachment", and this code iterates through all of them:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'orderby'=> 'menu_order',
'order' => 'ASC',
'post_mime_type' => 'image',
'post_status' => null,
'post_parent' => $post->ID
);
$attachments = get_posts( $args );
if ( $attachments ) {
foreach ( $attachments as $attachment ) {
echo wp_get_attachment_image($attachment->ID , 'full','',array('rel' => $attachment->post_name));
}
}
endwhile; endif; ?>
My question is how can I distinguish the attachments so that it only queries some of them? For example, I tried adding the post_name attribute to the $args array but that didn't do anything.
Second, when I add img tag to the visual/html content editor, and then I add a src attribute, and then I go into the visual content editor, I want a non-programmer to click on the img box, which prompts them to edit the image, and then under source it is requiring them to add the full url path, and I dont think that's intutive to a non-programmer. Is there an easier way for them to add image via content editor?