Show category description in shop grid
-
I’d like to be able to display the category description for each of the categories in our shop – both parent and child – either in an overlay below the h4 category title or underneath.
Our theme has a filter which governs this layout, and any attempts I’ve made to adapt it and add an additional div or span by including echo category_description() inside the h4 title tags has been unsuccessful – [https://tinyurl.com/75mh5sv4][1]
<div class="category-grid-item"> <a class="category-img" href="<?php echo esc_url( get_term_link( $c->slug, 'product_cat' ) ); ?>"> <?php $thumbnail_id = get_term_meta( $c->term_id, 'thumbnail_id', true ); $image = wp_get_attachment_image_src( $thumbnail_id, 'large' ); $image = isset( $image[0] ) ? $image[0] : wc_placeholder_img_src(); if ( isset( $image ) ) { ?> <img src="<?php echo esc_url( $image ); ?>" alt="<?php echo esc_attr( $c->name ); ?>" /> <?php } ?> </a> <h4 class="category-title"> <?php echo esc_html( $c->name ); ?><span class="count"><?php echo esc_attr( $c->count ); ?></span> </h4> </div> -
Hi there,
It appears that you’re using the open-source WordPress software and therefore you need to seek help at these forums:
https://wordpress.org/support/forums/
These forums are for providing support to WordPress.com hosted sites only. If you want to know more about the differences between WordPress.com and the WordPress software you can read this document:
- The topic ‘Show category description in shop grid’ is closed to new replies.