Add featured images to Genesis child theme archive page?

Community Forums Forums Design Tips and Tricks Add featured images to Genesis child theme archive page?

This topic is: resolved

This topic contains 19 replies, has 4 voices, and was last updated by  Marcy 5 months ago.

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #109573

    pattyayers
    Participant
    Post count: 19

    Hello all,

    I have a site using a simple Genesis child theme I built from the sample/starter child theme. I’m trying to make archive pages display the featured image with each post.

    I could really use some guidance on how to do this with Genesis child theme, if anybody could point me in the right direction. I found these instructions (below), but they’re for a non-Genesis theme.

    Either in your archive.php or category.php file (whichever file your theme calls, for instance Twenty Eleven calls archive.php), enter the following code right after your loop starts:

    <?php it_exchange_set_product( $post->ID ); ?>

    Then, where you want the image to show, enter this code:

    <?php it_exchange( 'product', 'featured-image', array( 'size' => 'thumbnail' ) ); ?>

    The site is at http://childsafetylibrary.com.

    Thanks very much in advance.

    Best,
    Patty

    • This topic was modified 5 months, 2 weeks ago by  pattyayers. Reason: I first said that I couldn't post the URL, but realized that I can
    • This topic was modified 5 months, 2 weeks ago by  pattyayers. Reason: I first said that I couldn't post the URL, but realized that I can
    #109580

    David Chu
    Participant
    Post count: 1408

    Hi,
    Here’s a way to get an archive to show featured image. This goes in functions.php.

    This forum software killed the PHP code, so I’ll try this instead. :-)

    See gist on Github

    This could be made more specific, as this will show featured on any type of archive, right below the title. You can also apply this sort of method elsewhere on a page, you’ll just need to get familiar with where the hooks are.

    Cheers, Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    #109581

    pattyayers
    Participant
    Post count: 19

    Dave, thank you. I just added that code to the child theme’s functions.php file, and for some reason, I still don’t see the featured images on archive pages such as this one: http://childsafetylibrary.com/product-category/special-reports/

    I triple-checked, and I did copy the code correctly.

    If you click on one of the “products” on that page, you’ll see the featured image being displayed on its single-post screen.

    Those posts are a custom post type, but the archive pages should display the featured image if we tell it to, according to the authors of the plugin, iThemes Exchange:

    http://ithemes.com/codex/page/Exchange_FAQs:_How_Do_I_Show_the_Product_Featured_Image_on_Archive/Category_Pages

    Any idea what I can try? I REALLY appreciate your help.

    Best,
    Patty

    #109582

    pattyayers
    Participant
    Post count: 19

    Ok, I see that you put the code on GitHub, and I went and copied it to my functions.php. It came out the same as the first try, though – meaning that I apparently was able to copy the code correctly the first time. So still not seeing the featured images and would be grateful for any further directions.

    Patty

    #109599

    David Chu
    Participant
    Post count: 1408

    Hi Patty,
    Yup, the code must have copied OK.

    Hard to say from out here. I would guess that you have a plugin that’s overriding normal WP and/or Genesis processing in order to mess around with its own custom post types and templates, and thus ignoring my plain vanilla Genesis/WP method for Post archives.

    If it’s a plugin, my suggestion would be to check its admin and see if there are any settings related to thumbnail or featured image. Finally, you could ask the developers if they can suggest a way to get the thumbnail onto the display.

    That’s about the best suggestion I can give without boots on the ground, I’m afraid. I know that frequently when I’m dealing with custom post types, I have to template them myself, which is a highly geeky job.

    Good luck,
    Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    #109600

    pattyayers
    Participant
    Post count: 19

    Yes, the plugin developers make it sound as if it’s quite straightforward:

    http://ithemes.com/codex/page/Exchange_FAQs:_How_Do_I_Show_the_Product_Featured_Image_on_Archive/Category_Pages

    They say (on that link above) just to add the featured image to the archive template just as you typically would. So it really seems like it should work.

    I did check for any settings I might have missed, good thinking.

    Thank you very much for your time, Dave. Maybe somebody else has an idea.

    Cheers,
    Patty

    #109603

    David Chu
    Participant
    Post count: 1408

    I see. Those are actually pretty good directions. Understandably, they are generalized for typical WP themes, not Genesis or other fancy frameworks. iThemes would work ’til doomsday if they tried to write instructions for every framework. Same with Woo Commerce and lots of other things.

    The general idea would be that you’d have to make an archive template in your child theme that overrides the stock Genesis one, and then add those goodies. Unless you’re a template hacker, it’s probably not worth your while, frankly.

    If you still want to do the extra work, there are various tutorials for that sort of thing, you could try one of these:

    http://www.carriedils.com/custom-page-template-genesis/

    Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    #109606

    pattyayers
    Participant
    Post count: 19

    Yes, that’s the struggle I have with Genesis, trying to figure out how to do things that I do all the time with regular themes and child themes. I make simple custom templates for non-Genesis sites all the time.

    Anyway, I’m not at all averse to making a custom Genesis template and will check out those tutorials. Thanks again for your time and guidance.

    Patty

    #109607

    braddalton
    Participant
    Post count: 10587

    Does the archive depend on using a premium addon for Product Categories?

    Product Categories

    This adds a category taxonomy for all products in iThemes Exchange.

    Hard to test a solution unless i have a copy of this addon.

    If you didn’t already know, StudioPress have created a plugin which includes 3 page templates which integrate perfectly with WooCommerce.


    #109611

    pattyayers
    Participant
    Post count: 19

    Hi Brad — Thank you — yes, I’m using that add-on. Is there something I can do to make it possible for you to test it?

    I’m deep into using Exchange on several sites, so switching e-commerce plugins at this point isn’t really practical. But thank you for letting me know, for possible future projects.

    Best,
    Patty

    #109614

    pattyayers
    Participant
    Post count: 19

    Just FYI, I did check out the video and tutorial Dave posted. The video was by somebody who admitted she had never used Genesis before and was just guessing, and even I knew she was doing it wrong. :-) The linked tutorial (and related tutorials it links to) are good stuff but don’t address this situation, unfortunately.

    Patty

    #109615

    pattyayers
    Participant
    Post count: 19

    Brad, iThemes provides these instructions for adding the featured image in a regular (non-Genesis) theme. I’m posting it again in case it tells you anything about how I should do this with Genesis.

    http://ithemes.com/codex/page/Exchange_FAQs:_How_Do_I_Show_the_Product_Featured_Image_on_Archive/Category_Pages

    If I can lend you that plugin for testing, I’d be glad to do it, if that’s kosher.

    Patty

    #109617

    braddalton
    Participant
    Post count: 10587
    #109620

    pattyayers
    Participant
    Post count: 19

    Hm.. that add-on isn’t like a normal plugin – it doesn’t appear on the plugins screen, or in the regular way in the plugins directory on the server. You enable it on an Exchange screen in the Admin. I’ll ask iThemes if they can provide a copy.

    Patty

    #109624

    pattyayers
    Participant
    Post count: 19

    I requested that. If they provide it, I’ll send it on to you.

    On the iThemes forum, somebody else is trying to do the same thing with a Genesis child theme, and they’re saying that they put the code calling the featured image into a Genesis Simple Hooks field, at the genesis_entry_content hook. Just wanted to mention that in case it can be done that way.

    Best,
    Patty

Viewing 15 posts - 1 through 15 (of 20 total)

You must be logged in to reply to this topic.