Community Forums › Forums › Archived Forums › Design Tips and Tricks › Add featured images to Genesis child theme archive page?
Tagged: archive template, child theme, featured image, genesis
- This topic has 19 replies, 4 voices, and was last updated 10 years, 5 months ago by Marcy.
-
AuthorPosts
-
June 13, 2014 at 7:50 am #109573pattyayersMember
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,
PattyJune 13, 2014 at 9:06 am #109580David ChuParticipantHi,
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. 🙂
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
June 13, 2014 at 9:21 am #109581pattyayersMemberDave, 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_PagesAny idea what I can try? I REALLY appreciate your help.
Best,
PattyJune 13, 2014 at 9:26 am #109582pattyayersMemberOk, 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
June 13, 2014 at 10:07 am #109599David ChuParticipantHi 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
June 13, 2014 at 10:16 am #109600pattyayersMemberYes, 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_PagesThey 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,
PattyJune 13, 2014 at 10:33 am #109603David ChuParticipantI 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
June 13, 2014 at 11:19 am #109606pattyayersMemberYes, 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
June 13, 2014 at 11:33 am #109607Brad DaltonParticipantDoes 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.
June 13, 2014 at 12:04 pm #109611pattyayersMemberHi 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,
PattyJune 13, 2014 at 1:26 pm #109614pattyayersMemberJust 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
June 13, 2014 at 1:42 pm #109615pattyayersMemberBrad, 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.
If I can lend you that plugin for testing, I'd be glad to do it, if that's kosher.
Patty
June 13, 2014 at 1:55 pm #109617Brad DaltonParticipantJune 13, 2014 at 2:14 pm #109620pattyayersMemberHm.. 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
June 13, 2014 at 2:41 pm #109624pattyayersMemberI 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,
PattyJune 13, 2014 at 3:00 pm #109628Brad DaltonParticipantIts included in the plugin and simply needs activating.
The best way to do this is to create a custom page template with the code in it.
Send me the plugin and i'll see what i can do.
June 15, 2014 at 9:38 am #109871pattyayersMember[braddalton wrote via email:]
Ok
What i did was code a custom template for this with 2 custom functions for displaying the featured images on product categories.
Attached is an example of the before and after shots.
This took some time and effort so I can’t provide it for free.
If you want this template my fee is $50.
The entry meta can easily be removed as well.
Let me know.
Thanks - Brad Dalton
http://wpsites.netBrad, I wasn't looking to hire someone, and had no idea you were planning to charge for helping. I had understood this to be a user-to-user community discussion forum.
Patty
June 26, 2014 at 1:38 pm #111663MarcyParticipantHi, Patty,
[Wow! I didn't think the whole Gist would paste here! Sorry about that; I just pasted the link.]
I don't know if you have this solved or not. I think I added the image a couple of months ago to a demo theme for a client, but can't find my notes. I ended up adding a new template for the category pages that is similar to the store layout, well, the client wanted a three across.
The rough demo is here for the category called Collections: http://amethystwebsitedesign.com/clients/lad/product-category/collections/
The page I started with is here:
The template itself - taxonomy-it_exchange_category.php - goes in your child theme folder.
You can add the store CSS directly to your child theme style.css or you can create a directory called: exchange and create a file called style.css in there for your Exchange styles.You probably don't need all the store styles, but that's all I can do at the moment.
I hope this helps you. I'll try to find the other template I used for just adding the image to a normal Genesis archive.
Marcy | Amethyst Website Design | Twitter
June 27, 2014 at 7:26 am #111739pattyayersMemberHi Marcy,
Thanks very much for this. Here's what transpired in the meantime. When I wasn't able to get it figured out, I actually checked on the specifications for the site and found out that I could work around it and not use an archive page with thumbnails.
But I really appreciate you sharing this and I will definitely save it in case I need to do this later with this site. Glad to know that others are using Genesis + Exchange successfully.
Thanks again,
Best,
PattyJune 27, 2014 at 9:07 am #111763MarcyParticipant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.