I'm doing a redesign of the woocommerce dashboard.
I had copy the dashboard.php from woocommerce folder to my theme folder.
So now I want to get rid of the side menu from dashboard only(Remain on other pages eg. account detail page)
Tried this code in dashboard.php, doesn't work.
add_filter ( 'woocommerce_account_menu_items', 'remove_my_account_links' );
function remove_my_account_links( $menu_links ){
unset( $menu_links['edit-address'] );
return $menu_links;
}
Understand this should be in function.php, but I only want to remove it from dashboard. How should I do that?
I'm doing a redesign of the woocommerce dashboard.
I had copy the dashboard.php from woocommerce folder to my theme folder.
So now I want to get rid of the side menu from dashboard only(Remain on other pages eg. account detail page)
Tried this code in dashboard.php, doesn't work.
add_filter ( 'woocommerce_account_menu_items', 'remove_my_account_links' );
function remove_my_account_links( $menu_links ){
unset( $menu_links['edit-address'] );
return $menu_links;
}
Understand this should be in function.php, but I only want to remove it from dashboard. How should I do that?
You can override the dashboard.php
template by copying it over to /your-theme/woocommerce/myaccount/dashboard.php
.
From there it should be easy to customize it to your needs.
Thanks everyone I have solved this..
On myaccount.php remove
do_action( 'woocommerce_account_navigation' );
also remove if you want your content to be on the center of pages
<div class="woocommerce-MyAccount-content"></div>
then, on my-order.php, edit-address.php etc add in above code in the correct position, then upload to your theme folder so any update of woocommerce won't override this change