Forum Replies Created
-
AuthorPosts
-
SteveKeymasterDocumentation has been updated > Thanks for the suggestion!
December 29, 2014 at 12:57 pm in reply to: About Conditional Custom post list and their taxonomy #3141
SteveKeymaster@khairulalamruet– Welcome to the Piklist community!
To do this you would need to assign all the taxonomies for each Post Type to different fields. Then hide/show the appropriate fields.
If you provide some more specific code, we would be happy to help you further.
SteveKeymaster@azizultex– This is really a different post. Your first one was ADVANCED Add-more’s… this is clearly a SIMPLE Add-More. In the future please create a new ticket.
All you need to do here is:
$exercises = get_post_meta($post->ID, 'exercise'); foreach ($exercises as $exercise => $value) { echo $value; }
SteveKeymasterYou should be able to use Meta Query to go the other way. Let me know if that works for you.
SteveKeymasterCurrently the Post Relationship field cannot be modified.
However, you can do something similar if you want.
In Piklist demos > Advanced Tab > Content Section (Grouped) field. We pull in Posts.
You can use this field as a guide to create your own. The Post ID would be saved as meta which you can query using get_posts.
Let us know if you need help.
SteveKeymaster@labofoz– great suggestions! We will get the docs updated. Feel free to send a patch to [email protected]
Thanks again!
SteveKeymaster@mrioa– I don’t believe Piklist ever allowed descriptions in Grouped fields. You can use ‘help’ instead:
, 'help => 'Additional info'
SteveKeymaster@coreyhunt– Glad you love it! Please use the Demos as a guide. You can literally copy and paste the code into your own projects.
If you have the time we would really appreciate a 5 Star review on WordPress.org… tell them how impressed you are. It really helps keep the project going.
SteveKeymaster@coreyhunt– Welcome to the Piklist community!
For simple group fields, like yours, you don’t have to assign the group field, to an actual field (i.e. dimensions). If you remove
,'field' => 'dimensions', the other two fields will just save as normal meta data and can be retrieved like this:$work_length = get_post_meta($post->ID, 'work-length', true); echo $work_length;
Also, 99.9% of the time you should not define
scope, and just let Piklist automatically set it.You new code would look like this:
piklist('field', array( 'type' => 'group' ,'label' => 'Artwork Dimensions' ,'list' => false ,'description' => 'Enter the dimensions of the artwork.' ,'value' => 'Default text' ,'help' => 'In inches.' ,'fields' => array( array( 'type' => 'text' ,'field' => 'work-length' ,'label' => 'Length' ,'columns' => 3 ,'attributes' => array( 'placeholder' => '0' ) ) ,array( 'type' => 'text' ,'field' => 'work-height' ,'label' => 'Height' ,'columns' => 3 ,'attributes' => array( 'placeholder' => '0' ) ) ) ));Let us know if this works for you.
SteveKeymaster@egamipeaks– Looks like a bug when you use Checkboxes in an advanced grouped add_more. Might not be a quick fix, so I suggest you choose another field configuration.
SteveKeymasterThis reply has been marked as private.
SteveKeymasterGreat! Glad it’s working. Closing ticket.
SteveKeymaster@dawood– The code you posted here looks just like the “Page Link” field.
piklist('field', array( 'type' => 'select' ,'field' => 'dawood' ,'columns' => 12 ,'attributes' => array( 'multiple' => 'multiple' ) ,'choices' => piklist( get_posts( array( 'post_type' => 'post' ,'orderby' => 'post_date' ) ,'objects' ) ,array( 'ID' ,'post_title' ) ) ));Since you are setting this field to allow for multiple values selected, you need to loop over the array:
foreach ($dawood as $key => $value) { echo '' . get_the_title($value) . ''; }The biggest difference here between ACF and Piklist, is that Piklist allows you to use standard WordPress functions like
get_permalink()andget_the_title(), while ACF makes you use it’s own functions. -
AuthorPosts