Created
March 23, 2016 11:08
-
-
Save txemaleon/297e01eb58b5540db17d to your computer and use it in GitHub Desktop.
Shortcode to display "My Orders" in a custom page, instead of in the "My Account" Page in WooCommerce
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 txl_my_orders_sc( $atts ) { | |
$atts = shortcode_atts( array( | |
'order_count' => -1, | |
), $atts )); | |
ob_start(); | |
wc_get_template( 'myaccount/my-orders.php', array( | |
'order_count' => $atts[ 'order_count' ], | |
)); | |
return ob_get_clean(); | |
} | |
add_shortcode( 'my_orders', 'txl_my_orders_sc' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I have this problem Parse error: syntax error, unexpected ')' in /home/wp_j545dc/aula.tallermultinacional.org/wp-content/themes/boss-child/functions.php on line 65