In the Genesis Facebook group a user asks:
I have a website with +1000 woocommerce producttags. Each of them has a genesis archive intro text that shows on the website. Is there a way to mass delete or hide this intro text?
Looking at /wp-content/themes/genesis/lib/structure/archive.php
we can see that genesis_do_archive_headings_intro_text()
function is hooked to genesis_archive_title_descriptions
on L335. The code for outputting archive intro text is in here.
The genesis_archive_title_descriptions
action itself has been set to be run inside a function that is hooked to genesis_before_loop
(L78).
To conditionally remove archive description from only the WooCommerce product_tag
taxonomy’s archive pages, we can go one level up in the actions hierarchy and set up a function hooked to genesis_before_content
to do the needful.
Add this at the end of your child theme’s functions.php
:
add_action( 'genesis_before_content', 'sk_remove_product_tags_taxonomy_description' );
/**
* Remove Taxonomy Description on WooCommerce product tag archives.
*/
function sk_remove_product_tags_taxonomy_description() {
// if we are not on a product tag taxonomy term archive page, abort.
if ( ! is_tax( 'product_tag' ) ) {
return;
}
remove_action( 'genesis_archive_title_descriptions', 'genesis_do_archive_headings_intro_text', 12, 3 );
}
Before:
After: