Connect with us

How to create WordPress custom permalink and custom post type?

you can declare custom post by the register_post_type tag:

$args = array(
‘label’ => __( ‘event’, ‘weera’ ),
‘description’ => __( ‘Dubai day event listings’, ‘event’ ),
‘labels’ => $labels,
‘supports’ => array( ‘title’, ‘excerpt‘, ‘author’, ‘thumbnail’, ‘revisions’),
‘hierarchical’ => false,
‘public’ => true,
‘show_ui’ => true,
‘show_in_menu’ => true,
‘menu_position’ => 5,
‘menu_icon’ => ‘palmtree’,
‘show_in_admin_bar’ => true,
‘show_in_nav_menus’ => true,
‘can_export’ => true,
‘has_archive’ => true,
‘exclude_from_search’ => false,
‘publicly_queryable’ => true,
‘capability_type’ => ‘page’,
‘rewrite’ => array( ‘slug’ => ‘event’),
‘has_archive’ => true,
);
register_post_type( ‘event’, $args );

and taxonomy ‘venu’ can be declare by the register_taxonomy:

$args = array(
‘labels’ => $labels,
‘hierarchical’ => true,
‘public’ => true,
‘show_ui’ => true,
‘show_admin_column’ => true,
‘show_in_nav_menus’ => true,
‘show_tagcloud’ => true,
‘rewrite’ => array( ‘slug’ => ‘venu’ ),
);

register_taxonomy( ‘venu’, array( ‘event’ ), $args );

Your Answer

Please login or Register to submit your answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.

Log In

Subscribe to our newsletter

Enter your email address to subscribe to blog and receive notifications of new articles by email.
100% Privacy. No spam guaranteed