Skip to content

Instantly share code, notes, and snippets.

@bekarice
Created October 7, 2015 20:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bekarice/660c6b54c42a89e26d0f to your computer and use it in GitHub Desktop.
Save bekarice/660c6b54c42a89e26d0f to your computer and use it in GitHub Desktop.
Create a WooCommerce size guide shortcode
<?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