ashatte
Necesito cambiar algunos elementos del menú en mi sitio de WordPress, pero la opción desapareció del área de administración. De acuerdo con la documentacióna Menús La opción debe aparecer debajo de la Apariencia menú, pero no está allí en mi instalación:
Como puedo conseguir Menús aparecer donde se supone que debe aparecer?
ashatte
El problema puede haber sido causado por un complemento malicioso que sobrescribió la funcionalidad, pero logré solucionarlo agregando un functions.php
archivo a mi tema personalizado (en el directorio raíz) con el siguiente código:
<?php
add_theme_support( 'menus' );
?>
Ahora Menús ha vuelto a aparecer:
Mansukh Khandhar
este código para hacer menú en wp admin.
![add_action('init', 'create_portfolio_post_type');
function create_portfolio_post_type() {
$args = array(
'description' => 'Portfolio Post Type',
'show_ui' => true,
'menu_position' => 4,
'exclude_from_search' => true,
'labels' => array(
'name' => 'Portfolios',
'singular_name' => 'Portfolios',
'add_new' => 'Add New Portfolio',
'add_new_item' => 'Add New Portfolio',
'edit' => 'Edit Portfolios',
'edit_item' => 'Edit Portfolio',
'new-item' => 'New Portfolio',
'view' => 'View Portfolios',
'view_item' => 'View Portfolio',
'search_items' => 'Search Portfolios',
'not_found' => 'No Portfolios Found',
'not_found_in_trash' => 'No Portfolios Found in Trash',
'parent' => 'Parent Portfolio'
),
'public' => true,
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => true,
'supports' => array('title', 'editor', 'thumbnail', 'comments', 'tags')
);
register_post_type('portfolio', $args);
}
Scott Wolter
You can also use of this code in your functions.php
to do more with your menu tab setting:
//menu//
function register_my_menus() {
register_nav_menus(
array( 'top-menu' => __( 'Top-Menu' ) )
);
}
You can also add many menu field as you need and replace it in your theme.
Make sure your file is named functions.php