- Click Photo Gallery from the menu on the left of your WordPress dashboard.
- From the list under Photo Gallery, click Options, then click the Gallery defaults tab.
- From the settings under the Thumbnails layout, find Thumbnails dimensions.
- The left box dictates your thumbnail’s width and the right box its height.
- To switch a landscape thumbnail into portrait view, its height should be larger than its width.
- Set your thumbnail’s dimensions accordingly.
- Click the Save button at the top right to save your settings. This will apply your selected option to every gallery that uses default options.
- Publish your gallery in a page or post.
To apply this setting to a single specific gallery that you’ve already published in one of your posts or pages, click the shortcode of the published gallery in your editor, uncheck the box next to Use default options, and follow the steps 3 to 6, then click Update.