• 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

Woocommcerce thumbnal in Genesis Archive Description

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 › Woocommcerce thumbnal in Genesis Archive Description

This topic is: not resolved

Tagged: Archive Description, category image, WooCommerce

  • This topic has 6 replies, 2 voices, and was last updated 10 years, 10 months ago by Peaceless.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • August 29, 2015 at 4:20 am #163981
    Peaceless
    Member

    Hi!

    I´m trying to figure out how to make the thumbnail you can upload to a product category in Woocommerce, to show up next to the Archive description. I figured since I can make this work for the "usual" description using the below code it would be better to use the same logic to pull it in the thumbnail rather than using HTML in the Archive description section, do you agree? Or is it pretty much the same? This is the code that I used for having the image show up in the "usual" description

    add_action( 'woocommerce_archive_description', 'woocommerce_category_image', 2 );
    function woocommerce_category_image() {
        if ( is_product_category() ){
    	    global $wp_query;
    	    $cat = $wp_query->get_queried_object();
    	    $thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true );
    	    $image = wp_get_attachment_url( $thumbnail_id );
    	    if ( $image ) {
    		    echo '<img src="' . $image . '" alt="" />';
    		}
    	}
    }

    Figure I should replace the 'woocommerce_archive_description' with something and tried to see this with the Visual hooks guide but I´m still lost. Am I on the right track? Or you think I should go with the HTML solution?

    August 29, 2015 at 5:31 am #163985
    Brad Dalton
    Participant

    You can copy over the archive-product.php from the genesis connect woo commerce plugin and add code to that file.

    <?php
    
    /** Remove default Genesis loop */
    remove_action( 'genesis_loop', 'genesis_do_loop' );
    
    /** Remove WooCommerce breadcrumbs */
    remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
    
    /** Uncomment the below line of code to add back WooCommerce breadcrumbs */
    //add_action( 'genesis_before_loop', 'woocommerce_breadcrumb', 10, 0 );
    
    /** Remove Woo #container and #content divs */
    remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );
    remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 );
    
    
    /** Get Shop Page ID */
    // @TODO Retained for backwards compatibility with < 1.6.0 WooC installs
    global $shop_page_id;
    $shop_page_id = get_option( 'woocommerce_shop_page_id' );
    
    
    add_filter( 'genesis_pre_get_option_site_layout', 'genesiswooc_archive_layout' );
    
    function genesiswooc_archive_layout( $layout ) {
    
    	global $shop_page_id;
    
    	$layout = get_post_meta( $shop_page_id, '_genesis_layout', true );
    
    	return $layout;
    }
    
    add_action( 'genesis_before_loop', 'genesiswooc_archive_product_loop' );
    
    function genesiswooc_archive_product_loop() {
    
    	global $woocommerce;
    	
    	$new = version_compare( $woocommerce->version, '1.6.0', '>=' );
    	
    	if ( $new )
    		genesiswooc_content_product();
    		
    	else
    		genesiswooc_product_archive();
    }
    
    genesis();
    

    Tutorials for StudioPress Themes.

    September 4, 2015 at 10:03 am #164583
    Peaceless
    Member

    hey!

    thanks but that made both the Archive Head line and archive intro text to disappear all together 🙂

    September 5, 2015 at 2:49 am #164646
    Brad Dalton
    Participant

    And then add code to that file to add whatever you like including the archive info.

    Did you add your code to the file?


    Tutorials for StudioPress Themes.

    September 5, 2015 at 9:51 am #164665
    Peaceless
    Member

    I took a shot and added the code I posted above to the functions.php to see if that was what you ment but it just got me the thumbnal in the ordinary description. So I guess I don´t follow you... 🙂

    Am I off target if I assume that 'woocommerce_archive_description' in the code I posted above is the "normal" archive description and I should replace that with whatever the Archive description, that genesis put in the archive settings page for a product, is called?

    September 5, 2015 at 10:05 am #164667
    Peaceless
    Member

    Hmm, now the description with the image using HTML has disappeared ....even if I delete the archive-product.php I copied over...strange

    September 6, 2015 at 9:51 am #164744
    Peaceless
    Member

    ah, it´s bug! doh!

    Category Archive Not Showing after Update

    geeez

    ok so I´m back at the thing with adding the thumbnail...

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 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