Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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' );

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