By default WordPress have different post types. Please have a look below listed once.
- Post
- Page
- Attachment
- Revision
- Nav Menu
Instead above If you are going to add your own post type like movies, services and games n all then you can definitely possible to create own post types.
On our WordPress site, post types are used to recognizing different content types in WordPress. Posts and pages are both post types but they are made to serve different purposes.
Add below code into functions file (functions.php)
You can see at wordpress admin dashboard side post type created (left side sidebar) named as ‘Services’
// Set UI labels for Custom Post Type
function custom_post_type() {
$labels = array(
'name' => _x( 'Services', 'Post Type General Name', 'twentytwentyone' ),
'singular_name' => _x( 'Service', 'Post Type Singular Name', 'twentytwentyone' ),
'menu_name' => __( 'Services', 'twentytwentyone' ),
'parent_item_colon' => __( 'Parent Service', 'twentytwentyone' ),
'all_items' => __( 'All Services', 'twentytwentyone' ),
'view_item' => __( 'View Service', 'twentytwentyone' ),
'add_new_item' => __( 'Add New Service', 'twentytwentyone' ),
'add_new' => __( 'Add New', 'twentytwentyone' ),
'edit_item' => __( 'Edit Service', 'twentytwentyone' ),
'update_item' => __( 'Update Service', 'twentytwentyone' ),
'search_items' => __( 'Search Service', 'twentytwentyone' ),
'not_found' => __( 'Not Found', 'twentytwentyone' ),
'not_found_in_trash' => __( 'Not found in Trash', 'twentytwentyone' ),
);
// Set other options for Custom Post Type
$args = array(
'label' => __( 'services', 'twentytwentyone' ),
'description' => __( 'Service news and reviews', 'twentytwentyone' ),
'labels' => $labels,
// Features this CPT supports in Post Editor
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),
// You can associate this CPT with a taxonomy or custom taxonomy.
'taxonomies' => array( 'genres' ),
/* A hierarchical CPT is like Pages and can have
* Parent and child items. A non-hierarchical CPT
* is like Posts.
*/
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
'show_in_rest' => true,
);
// Registering your Custom Post Type
register_post_type( 'services', $args );
}
/* Hook into the 'init' action so that the function
* Containing our post type registration is not
* unnecessarily executed.
*/
add_action( 'init', 'custom_post_type', 0 );
Eduardo Goodman
Henley Murray
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
Your article helped me a lot, is there any more related content? Thanks!
A code promo 1xBet est un moyen populaire pour les parieurs d’obtenir des bonus exclusifs sur la plateforme de paris en ligne 1xBet. Ces codes promotionnels offrent divers avantages tels que des bonus de dépôt, des paris gratuits, et des réductions spéciales pour les nouveaux joueurs ainsi que les utilisateurs réguliers.code promo 1xbet cote d’ivoire
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
Your article helped me a lot, is there any more related content? Thanks!
Entdecke auf bookofraclassic.de das authentische Spielerlebnis von Book of Ra Classic – völlig kostenlos und ohne Anmeldung. Dieser Kult-Spielautomat zieht Fans seit Jahren in seinen Bann. Mit nur einem Klick kannst du Book of Ra Classic kostenlos spielen ohne Anmeldung und dich auf Schatzsuche begeben. Probiere den beliebten Slot Book of Ra sofort aus – gratis und jederzeit verfügbar! book of ra classic kostenlos spielen ohne anmeldung
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article. https://accounts.binance.info/en/register-person?ref=JHQQKNKN
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?