Change image size on category pages
Most of our WordPress Themes come with custom built-in category pages – example here.
If you would like to change the image size that displays on the category pages, here's how:
1. First, we'll need to determine what image sizes are available in your theme and their names. Go to WordPress > Appearance > Editor > Functions.php. Locate this section:
//* Add new image sizes add_image_size( 'featured-long', 600, 850, TRUE ); add_image_size( 'featured-wide', 800, 560, TRUE ); add_image_size( 'featured-square', 600, 600, TRUE ); add_image_size( 'single-post-featured', 1000, 500, true );
Keep in mind that each theme has its own unique image sizes, so this section might look different depending on which theme you're using.
2. In the image size section, look at the size options and choose the one that you want to use on the category pages. Don't make any edits in this file – just write down the name of your chosen image size somewhere. In the example above, if you want the square image size, you would write down featured-square.
3. Next, while still in the Editor, go to the Category.php file. Scroll down to the bottom of the file. Locate this section:
4. Find the image size, which is highlighted below:
Again, this is going to vary from theme to theme. The name of the image size in your own theme may be different, but the instructions are the same.
5. Replace the current image size with the name of your NEW image size. In our example, you would replace featured-long with featured-square. Be sure to keep everything around the image size name the EXACT same, including the single quote mark that immediately follows it.
6. Click "Update File" and you're done!