Answer the question
In order to leave comments, you need to log in
How to display a custom post in the menu?
There are functions that allow you to make a custom post directly from the admin panel:
function my_first_custom_post( ){
$args = array(
'labels'=>array(
'name'=>'Cars',
'singular_name'=>'Car',
),
'hierarchical'=>true,
'public'=>true,
'has_archive'=>true,
'menu_icon'=> 'dashicons-car',
'supports'=>array('title','editor','thumbnail','custom-fields'),
'rewrite'=>array('slug'=>'q-car'),
);
register_post_type( 'cars', $args);
};
add_action("init","my_first_custom_post");
function my_first_taxonomy(){
$args = array(
'labels'=>array(
'name'=>'Brands',
'singular_name'=>'Brand',
),
'public'=>true,
'hierarchical'=>true,
);
register_taxonomy('brands',array('cars'),$args);
}
add_action("init","my_first_taxonomy");
Answer the question
In order to leave comments, you need to log in
On the menu editing page, there is a pop-up window at the top - screen settings. Open them and enable your post type
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question