Let’s assume that you’d like to hide the WooCommerce menu for a certain user role, shop manager to be exact, and looking for a way to do it.
Using the capability together with the remove_menu() function, we can disable WooCommerce menu for any user roles. The function below is going to hide WooCommerce menu items for everyone except for admin.
add_action( 'admin_menu', 'remove_woocommerce_menu' );
function remove_woocommerce_menu(){
if ( !current_user_can('manage_options') ) {
remove_menu_page( 'woocommerce' ); // Menu slug for WooCommerce
}
}
WordPress will allow you to modify or remove the <ul> element from wp_nav_menu but that’s it. You cannot remove the <li> items of the navigation by using the default parameters.
Using a simple PHP function, we can easily remove the li items as well, and this is how you can do it.
We’ve been quiet the past few months working on a number of things to enhance our framework even further. We do this so that as each new theme is released, we can confidently claim that a higher level of functionality, but also that users have even more options to run professional sites.
That being said, you will love the new design and features in our next theme.
Following the release of our new WordPress magazine theme, we have an e-commerce theme in the pipeline. Stay tuned for more announcements or sign up to RSS feed or our monthly newsletter.
Sharp Magazine is one of my favorite themes that was designed by Charlie early last year and it didn’t take long to become of one of our top sellers. Sharp was built up with a lot of unique features including but not limited to colored navigation, newsletter signup widget, large sidebar ads, infinite colors, elegant footer as well as homepage, category & post templates.
While there was no need to update it, we still wanted to sharpen and make it even a better theme than it was. But as usual, the list of features that we wanted to add got expanded along the way and at the end, there was almost not a single file that was not edited.
As usual, to our loyal fans and first-time buyers, we are offering the promo code – SHARP – for 35% off the regular price of this amazing theme. Hurry, the coupon code is only valid until June 1, Monday 11:59PM EST