Created
June 11, 2018 21:17
-
-
Save gareth-gillman/0cb54293accdb617d143303c441c3eda to your computer and use it in GitHub Desktop.
add button to woocommerce category
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gg_cat_btn() { | |
if( is_tax( 'product_cat' ) ) { | |
add_action( 'woocommerce_after_shop_loop_item_title', 'gg_readmore_btn' ); | |
} | |
} | |
add_filter( 'woocommerce_after_shop_loop_item', 'gg_cat_btn' ); | |
function gg_readmore_btn() { | |
echo '<a class="cat-btn" href="'.get_permalink().'">'.__( 'Book / Get quote!', 'your-plugin' ).'</a>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment