• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to set the featured image size on a custom post type archive

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to set the featured image size on a custom post type archive

This topic is: not resolved

Tagged: archive, Custom Post Type, featured image

  • This topic has 2 replies, 2 voices, and was last updated 10 years, 6 months ago by AJD.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 26, 2015 at 9:09 am #160494
    AJD
    Member

    I have created a custom post type with a custom archive template.

    New image size added (in functions.php):

    //* Add new image sizes
    add_image_size('local-thumbnail', 250, 250, TRUE);

    In the archive template (archive-local.php) I moved the featured image

    //Move featured image
    remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
    add_action( 'genesis_entry_header', 'genesis_do_post_image', 3 );

    All I need to do is change the 'genesis_do_post_image' with my new image size, but can't figure out how to do it.

    Thanks.

    July 26, 2015 at 1:24 pm #160507
    Craig
    Member

    Here's a code snippet I've used in the past to accomplish this:

    remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
    add_action( 'genesis_entry_header', 'themeprefix_featured_photo', 3 );
    /**
     * Remove standard genesis_do_post_image 
     * and add an alternative featured image size
     */
    function themeprefix_featured_photo() {
        if ( $image = genesis_get_image( array( 'format' => 'url', 'size' => 'local-thumbnail' ) ) ) {
                printf( '<div class="featured-image"><img src="%s" alt="%s" /></div>', $image, the_title_attribute( 'echo=0' ) );
        }
    }

    Hope this helps.


    @craigsimps | craigsimps.com

    July 26, 2015 at 2:54 pm #160516
    AJD
    Member

    Excellent, worked great! Thank yoU!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble