creați un tip de postare personalizat cu categoria în funcțiile wordpress.php
function create_posttype() {
register_post_type( 'wpll_product',
array(
'labels' => array(
'name' => __( 'Products' ),
'singular_name' => __( 'Product' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'products'),
)
);
}
add_action( 'init', 'create_posttype' );
obțineți numele personalizat post tip wordpress
$pt = get_post_type_object( 'books' );
// These two usually contain the post type name in plural.
// They may differ though.
echo $pt->label;
echo $pt->labels->name;
// This one holds the post type name in singular.
echo $pt->labels->singular_name;