admin管理员组文章数量:1022695
I need to remove menu items from the menu section in the Wordpress theme customizer. Below are the screen shots:
I have tried many things, but they didn't work. I just need to remove menu items from the menu.
function remove_unnessory_item_customizer($wp_customize) {
$wp_customize->remove_section("themes");
/// $wp_customize->remove_section("available-menu-items");
// $wp_customize->remove_section("content");
// $wp_customize->remove_panel("nav_menus");
$wp_customize->remove_section( 'static_front_page' );
}
add_action('customize_register', 'remove_unnessory_item_customizer', 9999);
I need to remove menu items from the menu section in the Wordpress theme customizer. Below are the screen shots:
I have tried many things, but they didn't work. I just need to remove menu items from the menu.
function remove_unnessory_item_customizer($wp_customize) {
$wp_customize->remove_section("themes");
/// $wp_customize->remove_section("available-menu-items");
// $wp_customize->remove_section("content");
// $wp_customize->remove_panel("nav_menus");
$wp_customize->remove_section( 'static_front_page' );
}
add_action('customize_register', 'remove_unnessory_item_customizer', 9999);
Share
Improve this question
edited Jan 12, 2018 at 17:21
tklodd
1296 bronze badges
asked May 25, 2017 at 13:33
mohammed kaleemullamohammed kaleemulla
112 bronze badges
2
- To clarify - are you asking how to remove the ability to adjust Menus from the Customizer? Or are you trying to remove only certain post types from being added to a Menu in the Customizer? – WebElaine Commented May 25, 2017 at 15:54
- Just I need to Remove the Page Items from the Menus of customizer – mohammed kaleemulla Commented May 26, 2017 at 4:23
1 Answer
Reset to default 1Finally I was able to solve the above after researching on the net. Here I have removed the menu items by unregistering the content type.
function remove_post_types() {
global $wp_post_types;
if ( isset( $wp_post_types[ 'post' ] ) ) {
unset( $wp_post_types[ 'post' ] );
unset( $wp_post_types[ 'post' ] );
return true;
}
return false;
}
add_action('init', 'remove_post_types');
I need to remove menu items from the menu section in the Wordpress theme customizer. Below are the screen shots:
I have tried many things, but they didn't work. I just need to remove menu items from the menu.
function remove_unnessory_item_customizer($wp_customize) {
$wp_customize->remove_section("themes");
/// $wp_customize->remove_section("available-menu-items");
// $wp_customize->remove_section("content");
// $wp_customize->remove_panel("nav_menus");
$wp_customize->remove_section( 'static_front_page' );
}
add_action('customize_register', 'remove_unnessory_item_customizer', 9999);
I need to remove menu items from the menu section in the Wordpress theme customizer. Below are the screen shots:
I have tried many things, but they didn't work. I just need to remove menu items from the menu.
function remove_unnessory_item_customizer($wp_customize) {
$wp_customize->remove_section("themes");
/// $wp_customize->remove_section("available-menu-items");
// $wp_customize->remove_section("content");
// $wp_customize->remove_panel("nav_menus");
$wp_customize->remove_section( 'static_front_page' );
}
add_action('customize_register', 'remove_unnessory_item_customizer', 9999);
Share
Improve this question
edited Jan 12, 2018 at 17:21
tklodd
1296 bronze badges
asked May 25, 2017 at 13:33
mohammed kaleemullamohammed kaleemulla
112 bronze badges
2
- To clarify - are you asking how to remove the ability to adjust Menus from the Customizer? Or are you trying to remove only certain post types from being added to a Menu in the Customizer? – WebElaine Commented May 25, 2017 at 15:54
- Just I need to Remove the Page Items from the Menus of customizer – mohammed kaleemulla Commented May 26, 2017 at 4:23
1 Answer
Reset to default 1Finally I was able to solve the above after researching on the net. Here I have removed the menu items by unregistering the content type.
function remove_post_types() {
global $wp_post_types;
if ( isset( $wp_post_types[ 'post' ] ) ) {
unset( $wp_post_types[ 'post' ] );
unset( $wp_post_types[ 'post' ] );
return true;
}
return false;
}
add_action('init', 'remove_post_types');
本文标签: pluginsHow to remove menus items from Menu section from WordPress theme customizer
版权声明:本文标题:plugins - How to remove menus items from Menu section from WordPress theme customizer 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745559832a2156095.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论