โดย thatsawan » 25/10/2016 12:02 pm
โค้ด: เลือกทั้งหมด
//create_post_type
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'type_post_product',
array(
'labels' => array(
'name' => __( 'Products Demo' ),
'singular_name' => __( 'Product Demo' )
),
'public' => true,
'has_archive' => true,
)
);
}
ผลที่ได้
ศึกษาเพิ่มเติมได้ที่นี่
https://codex.wordpress.org/Function_Re ... _post_type
[code=php]//create_post_type
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'type_post_product',
array(
'labels' => array(
'name' => __( 'Products Demo' ),
'singular_name' => __( 'Product Demo' )
),
'public' => true,
'has_archive' => true,
)
);
}
[/code]
[b]ผลที่ได้ [/b]
[img]http://snap.mindphp.com/index.php?view=2016Oct24_580dd4f7131d0[/img]
[img]http://snap.mindphp.com/index.php?view=2016Oct24_580dd5195e1ac[/img]
[img]http://snap.mindphp.com/index.php?view=2016Oct24_580dd4df52ad3[/img]
ศึกษาเพิ่มเติมได้ที่นี่
https://codex.wordpress.org/Function_Reference/register_post_type