Automatically adding blog images to a portfolio/gallery

To answer your question properly, and get the right output, we’d need to know many things, but, say that a) all of the images that you use in your blog posts are attached as featured images to them, and b) you want them all, and c) you don’t care, at least at this point, about refining the output further, and d) you’re OK with them being output as ‘full’-sized images, as re-sized by your theme, you could start with something like the following, as a shortcode to be added to a page in your blog: You’d add the code to your theme’s functions.php file, and put the shortcode [add_gal] in a new Page.

Note: This will be very primitive – among those many things we’d need to know would be what you want the gallery and its contents to look like! Also, adding via shortcode just happens to be one simple of way of demonstrating this: There are several other major modes for achieving this effect. This is just one that a beginner might be able to test out without, say, having to learn how to create and modify templates or add functions to them, and so on.

add_shortcode( 'add_gal', 'add_a_gallery_of_featureds' ) ; 

function add_a_gallery_of_featureds() {

/* "-1" says "all posts" so, if you have a lot of posts, you might 
want to choose a reasonable number 
like 10 or 25 or so 
even just for testing purposes */   
$my_query = new WP_Query( array( 'posts_per_page' => -1 ) ) ;

    if ( $my_query->have_posts() ) {

        while ( $my_query->have_posts() ) {

            $my_query->the_post() ;

            the_post_thumbnail( 'full' ) ;

        }

    }

}

Now, unless you have only a relatively small number of posts AND your images at “full” or whatever size are just how you want them all to come out, and you don’t want to add titles or links or other information, this will be only a beginning point. As for making something more usable, you can find a lot of additional indications from the WordPress Codex, under WP_Query and the_post_thumbnail.

If you don’t have a featured/thumbnail image for each post, but are instead working with other “attached” images, then you won’t be able to use the_post_thumbnail, but that’s getting into to those unanswered questions… If you want something great… you may need to hire a pro…