Created
October 7, 2015 20:44
-
-
Save bekarice/660c6b54c42a89e26d0f to your computer and use it in GitHub Desktop.
Create a WooCommerce size guide shortcode
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
<?php | |
/** | |
* Only copy opening php tag if needed | |
* Creates a [wc_size_guide] shortcode | |
*/ | |
function sww_wc_size_guide_shortcode() { | |
ob_start(); | |
// Paste your table data inside the "echo" (replace the <table> stuff here with your table HTML) | |
echo ' | |
<table class="wc-size-chart">...</table> | |
'; | |
return ob_get_clean(); | |
} | |
add_shortcode( 'wc_size_guide', 'sww_wc_size_guide_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment