Custom Post Type’lara Custom Taxonomy Eklemek

Post Type’ımıza “Anahtar Kelime” eklemek istediğimizi varsayıyorum. En basit haliyle Custom Post Type’lara Custom Taxonomy eklemek için bu yazıdaki örnek kodda

register_post_type( 'products', $args );

satırının hemen altına

$tax_labes = array(
	'name' => 'Anahtar Kelime',
	'singular_name' => 'Anahtar Kelime',
);
$tax_args = array(
	'labels' => $tax_labes,
);
register_taxonomy( 'anahtarkelime', 'products' , $tax_args );

eklememiz yeterli.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>