Revert to Default WooCommerce Styling (for My-account Page Only)

I found thefollowing code on WooCommrece MyAccount page styling is broken

// Revert Woocommerce Styles // =============================================================================
function revert_woo_styles(){
  remove_action( 'x_enqueue_styles', 'x_woocommerce_enqueue_styles', 10, 2 );  
}
add_action( 'after_setup_theme', 'revert_woo_styles' );
// =============================================================================

This is to fix the fact X Theme changes default woocommerce my acount page to 1 column, horizontally aligned. But it also changes all other X WooCommerce theme templates. How can I apply it just to the logged in my account page.

The result achieved should be like Woocommerce vertical my account tabs

Thanks!

Hi @kademcconville,

Thanks for reaching out.
To revert the styles only for the My Account page you need to add the Conditional Tag for My Account page in the code, it will look like the following.

function revert_woo_styles()
{
    if(is_account_page())
    {
        remove_action( 'x_enqueue_styles', 'x_woocommerce_enqueue_styles', 10, 2 ); 
    }
}
add_action( 'after_setup_theme', 'revert_woo_styles' );

Remember that the above code will work if copied as it is and don’t conflict with any existing style.
Please note that the code provided serves only as a guide to help you get started custom coding on your own if there’s no option offered in our theme or the products we bundle.
We do not provide support for custom codes that means we can’t fix it in case it conflicts with something on your site nor will we enhance it.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.