Created
March 15, 2013 08:34
-
-
Save kloon/5168345 to your computer and use it in GitHub Desktop.
WooCommerce Product Up-Sells 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 | |
add_shortcode( 'product_upsells', 'wc_upsells_shortcode' ); | |
function wc_upsells_shortcode( $atts ) { | |
extract( shortcode_atts( array( | |
'posts_per_page' => '-1', | |
'columns' => '2', | |
'orderby' => 'rand' | |
), $atts ) ); | |
woocommerce_get_template( 'single-product/up-sells.php', array( | |
'posts_per_page' => $posts_per_page, | |
'orderby' => $orderby, | |
'columns' => $columns | |
) ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment