Change markup in WooCommerce shortcode output
问题 Is it possible to use a WooCommerce shortcode e.g. [product_category category="appliances"] amending the markup to include a <div> tag around some elements? I know I can do this by duplicating what the shortcode does but that seems overkill just to add a wrapping <div> . I could do it with jQuery but don't want any delay in them loading. 回答1: @Updated Yes this is absolutely possible. You can achieve this with something like that: if( !function_exists('prod_cat') ) { function prod_cat( $atts )