Site logo

Archived topic

Move location of WooCommerce Category Description below products

10 replies · Started by Sebastian on October 12, 2017

Viewing posts 1–11 of 11

Hi Tom and Team,

since I'm using your awesome work more and more and recommend it to friends I came across a small feature I'd like to see in an upcoming release OR just have a little snippet for the functions.php or style.css to move the category text in WooCommerce below the products.

I want to write a little more in my category description and don't want my products being pushed down to far. Any way you can help me out?

Thank you in any case and best regards.

Hmm, I wonder if you could do this:

add_action( 'wp', 'tu_move_wc_archive_description' );
function tu_move_wc_archive_description() {
    if ( is_archive() ) {
        remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
        remove_action( 'woocommerce_archive_description', 'woocommerce_product_archive_description', 10 );

        add_action( 'woocommerce_after_main_content', 'woocommerce_taxonomy_archive_description', 10 );
        add_action( 'woocommerce_after_main_content', 'woocommerce_product_archive_description', 10 );
    }
}

Hi Tom,
I implemented it via the Snippets plugin yet to no avail. (already used this plugin with snippets to alter some text on the page)
Neither does the description disappear before the products nor does it appear after them.
Snippet is still active on my site right now.
Any other ideas?
Thanks for any help. :)

Hmm, I'm afraid that was my only idea. You may need to ask WooCommerce support, as they're more familiar with their hooks etc..

Let me know if they're not able to help :)

Hi Tom,

thank you for your response.
Yes, great idea. I'll ask them and will share my findings as a reference for other users if it works.
Thank you for your ideas and support.

Have a nice weekend.

Thank you! You too :)

Hello guys!

Sabastian, did you make it work?

Thanks
Henrique

Hi Henrique

if you have a site we can look at and explain your exact requirements we can have a look to help. If so please raise a new topic and where you can add a Site URL privately and we can assist.

Hey Henrique,

yes I solved it. Have a look at one of my categories at my site

Here is the code that made that happen:

add_action('woocommerce_archive_description', 'custom_archive_description', 2 );
function custom_archive_description(){
    if( is_product_category() ) :
        remove_action('woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
        add_action( 'woocommerce_after_main_content', 'woocommerce_taxonomy_archive_description', 5 );
    endif;
}

Now as you can see at the moment the description at the bottom is very short, but I will write a longer one.
At the top of the page I used a page header (in the future: Page Hero Element) and under LAYOUT - WOOCOMMERCE I disabled the breadcrumbs and page title.

Exactly what I was looking for
Couul you please add some screenshots of how you have implemented it (and where)
I have created a hook and pasted it but is not working so I might not be doing it right. But I have no ide about writting code

This archived topic is closed to new replies.