• 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

Viewing 1 replies (of 1 total)
  • Thread Starter roadstardesign

    (@roadstardesign)

    When the dashboard crashes I get this error:

    Warning: Cannot modify header information – headers already sent by (output started at /Applications/MAMP/htdocs/simonearthur/wp-content/themes/twentysixteen-child2/functions.php:9) in /Applications/MAMP/htdocs/simonearthur/wp-login.php on line 387

    Line 6 in functions.php contains the add_image_resize

    I can’t figure out how all of these things are connected. Thanks again for your time.

Viewing 1 replies (of 1 total)
  • The topic ‘Creating a front-page with featured image gallery.’ is closed to new replies.