Creating a front-page with featured image gallery.
-
Hi there,
I have done a few things to execute my plan of creating a ‘gallery’ of 300×300 pixel thumbs of featured images of posts from a particular gallery. I am running into a few problems and was hoping somebody could help me out.Here’s what I did:
added this to functions.php:
<?php add_image_size( 'simgal', 300, 300, array('center','center') ); ?>
added this to front-page.php:
<?php $category_id = get_cat_ID('Artwork'); $q = 'cat=' . $category_id; query_posts($q); if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="imggrid"> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('simgal'); ?></a> </div> <?php endwhile; endif; ?>
I have two problems:
1) The images are not cropping. They appear to be taking the 300px width and soft adjusting the height.
2) The add_image_size call is breaking my dashboard, and I have to constantly rename my theme folder to get it to work again.
Added thoughts: I installed and ran (and reran) the Regenerate Thumbnails plugin, which appears to do nothing.
Any ideas are greatly appreciated. I’m pretty new at this! Thanks much for your time.
-Bill
- The topic ‘Creating a front-page with featured image gallery.’ is closed to new replies.