Skip to content

Instantly share code, notes, and snippets.

@txemaleon
Created March 23, 2016 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save txemaleon/297e01eb58b5540db17d to your computer and use it in GitHub Desktop.
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
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' );
@eduardogeeksservices
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment