WordPress Custom Post

/* Custom Service Post */
register_post_type( ‘service’, /* seen at the URL as a parameter and a unique id for the custom post */
array(
‘labels’ => array(
‘name’ => __( ‘Service’,’Service’ ), /* The Label of the custom post */
‘singular_name’ => __( “Service”, ‘oudarya_textdomain’ ), /* The Label of the custom post */
‘add_new’ => __( ‘Add New’, ‘Service’, ‘oudarya_textdomain’ ),
‘add_new_item’ => __( ‘Add New Service’, ‘oudarya_textdomain’ ),
‘new_item’ => __( ‘New Service’, ‘oudarya_textdomain’ ),
‘edit_item’ => __( ‘Edit Service’, ‘oudarya_textdomain’ ),
‘view_item’ => __( ‘View Service’, ‘oudarya_textdomain’ ),
‘all_items’ => __( ‘All Service’, ‘oudarya_textdomain’ )
),
‘public’ => true,
‘menu_icon’ => ‘dashicons-screenoptions’,
‘has_archive’ => true,
‘rewrite’ => array(‘slug’ => ‘service’), /* The slug of the custom post */
‘supports’ => array( ‘title’), /* enable basic for text editing */
)
);
function wpb_change_title_text( $title ){
$screen = get_current_screen();

if ( ‘service’ == $screen->post_type ) {
$title = ‘Enter service title here’;
}

return $title;
}

add_filter( ‘enter_title_here’, ‘wpb_change_title_text’ );

Advertisements

Published by

oudarya

I am a developer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s