Advertisement
drkskwlkr

Hide navigation section in WooCommerce User Panel

Jan 12th, 2024 (edited)
1,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | Source Code | 0 0
  1. <?php
  2.  
  3. // Hide Navigation panel from WooCommerce My Account Page
  4. add_action('wp_footer', function () {
  5.     if (is_account_page()) {
  6.         echo '<style>
  7.         .woocommerce-MyAccount-navigation { display: hidden; width: 0; height: 0; overflow: hidden; float: unset; }
  8.         .woocommerce-MyAccount-content { float: unset; width: 100%; }
  9.        </style>';
  10.     }
  11. });
  12.  
  13. // Add back Log out button in bottom right corner
  14. add_action('woocommerce_after_my_account', function() {
  15.     $logout_url = wp_logout_url();
  16.     echo '<div style="text-align: right;"><a href="'. $logout_url .'" class="button">' . __('Log Out', 'default') . '</a></div>';
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement