- This topic has 5 replies, 2 voices, and was last updated 3 years, 1 month ago by
Steve.
-
AuthorPosts
-
-
December 19, 2018 at 10:12 am #9254
nahoma12Participanthi, i am new using piklist and i create cpt called organization and i create fields inside
<?php
/*
Title: organization CPT
Post Type: organizations
Taxonomy: gt_org_taxonomy, gt_org_city_taxonomy
Context: normal
Priority: high*/
piklist(‘field’, array(
‘type’ => ‘select’
,’title’ => ‘Rooms’
,’choices’ => piklist(get_posts(array(
‘numberposts’ => -1
,’post_type’ => ‘rooms’
)), array(‘ID’, ‘post_title’))
,’relate’ => array(
‘scope’ => ‘post’
)
,’attributes’ => array(
‘multiple’ => ‘multiple’
)
));piklist(‘field’, array(
‘type’ => ‘file’
,’field’ => ‘feature_image’
,’scope’ => ‘post_meta’
,’label’ => ‘Feature image’
,’options’ => array(
‘basic’ => true
)
));
piklist(‘field’, array(
‘type’ => ‘textarea’,
‘field’ => ‘my_description’,
‘label’ => ‘Description’,
‘attributes’ => array(
‘rows’ => 10,
‘cols’ => 50,
‘class’ => ‘large-text’
)
));
.
.
.
.
while i try to add data on cpt fields its not normalit may be in edit mood but how can i change normal page?
i expect this org cpt.png
problem is this both screen shootif you have any idea please help me ..thanks.
Attachments:
You must be logged in to view attached files. -
December 19, 2018 at 10:53 pm #9258
SteveKeymaster@nahoma12– Welcome to the Piklist community!
Based on the screenshots, your custom CPT is using Gutenberg, which Piklist does not support.
To change your CPT to the classic editor, when you register your post type:
-setshow_in_restto false.
-make sure thesupportsarray doesn’t include editorIf you’re confused feel free to post the code you used to register your post type and we’ll fix it up for you.
-
December 20, 2018 at 4:00 pm #9259
nahoma12Participanthi steve thanks for your fast response, classic editor working and i add taxonomy, i want select list type of taxonomy, but it don’t work. here is the code.
add_filter('piklist_taxonomies', 'org_type_taxonomy'); function org_type_taxonomy($taxonomies) { $taxonomies[] = array( 'post_type' => 'organizations' ,'name' => 'orgtype' ,'show_admin_column' => true ,'configuration' => array( 'hierarchical' => true ,'labels' => piklist('taxonomy_labels', 'orgtype') ,'hide_meta_box' => false ,'show_ui' => true ,'query_var' => true ) ); return $taxonomies; }i add this on the custom plugin php file
<?php /* Title: taxonomy for my org cpt Description: type of org Taxonomy: orgtype */ piklist('field', array( 'type' => 'select' ,'scope' => 'taxonomy' ,'field' => 'orgtype' ,'label' => 'Org Type' ,'description' => 'Terms will appear when they are added to this taxonomy.' ,'choices' => array( '' => 'Choose Term' ) + piklist(get_terms('org_type_taxonomy', array( 'hide_empty' => false )) ,array( 'term_id' ,'name' ) ) ));i add this on the part/setting/taxonomy.php
but i doesn’t work i try with out the taxonomy.php and with taxonomy.php same out came (check box taxonomy) , i think my custom plugin .php is not reading my taxonomy.php or some code error.
and where to add this code
function my_register_taxonomy_for_cpts() { register_taxonomy_for_post_type('orgtype', 'post'); } add_action('init', 'my_register_taxonomy_for_cpts');please help me
Attachments:
You must be logged in to view attached files. -
December 21, 2018 at 7:25 am #9261
-
December 22, 2018 at 1:07 pm #9264
nahoma12ParticipantPLEASE i am waiting the answer ..please!!!
-
December 22, 2018 at 2:32 pm #9265
SteveKeymasterI’m not following this. Please zip up your plugin and email to [email protected]
-
-
AuthorPosts
- You must be logged in to reply to this topic.