Custom Upload Panel in Menu Bar

I think it’s not necessary to use a theme folder to hold some slider pictures.

You can use a post or a page to be the “gallery holder” (it can even be left as draft), and pull its image attachments like this:

function getSimpleGal($id){

    $results = get_children( array(
        'post_parent' => $id, 
        'post_status' => 'inherit', 
        'post_type' => 'attachment', 
        'post_mime_type' => 'image', 
        'order' => 'ASC', 
        'orderby' => 'menu_order ID') );

    foreach ( $results as $image ) {

        // instead of "full", use your custom image size
        $attachmentimage=wp_get_attachment_image_src( $image->ID, "full" );

        echo '<img src="'.$attachmentimage[0].'" title="'.$image->post_title.'" width="'.$attachmentimage[1].'" height="'.$attachmentimage[2].'" />';

    }
}

Leave a Comment